private void SendBytes(byte[] data) { var session = coreServer.GetSession(ClientSocket); ClientSocket.Send(data); ReleaseSession(); /* * Client.BeginReceive(session.SessionStorage, 0, * Server.GlobalInstance.BufferSize, * SocketFlags.None, * Server.GlobalInstance.ReceiveCallback, * Client); */ }
private void TryGetSession() { for (int i = 0; i < 3; i++) { session = coreServer.GetSession(clientSocket); if (session != null) { return; } else { Thread.Sleep(100); } } }
public SocketSession GetSession(Socket clientSocket) { return(realServer.GetSession(clientSocket)); }