thread safety for g_AcceptedSocket

Because g_AcceptedSocket Could rewrite before clientSession created, I Try lock rewrite g_AcceptedSocket until that socket register on clientSession.