public SocketAsyncEventArgs GetArgs() { int freeIndex = 0; while (!m_freeObjects.TryDequeue(out freeIndex)) { Thread.Sleep(0); } return m_eventArgs[freeIndex]; }
public ServerEntity(Socket socket, int worldID, World world, SocketAsyncPool asyncPool) : base(socket, worldID, asyncPool.GetArgs(), asyncPool.GetArgs()) { m_asyncPool = asyncPool; Name = worldID.ToString(); m_world = world; }