private void MessageInputHandler(string message, SocketAsyncEventArgs socketAsync, int erorr) { if (socketAsync.UserToken != null) { Service.Disconnect(socketAsync.UserToken as RPCUserInfo); } socketAsync.UserToken = null; socketAsync.AcceptSocket.Close(); socketAsync.AcceptSocket.Dispose(); LogAction.Log(message); }
private bool ConnectionFilter(SocketAsyncEventArgs socketAsync) { LogAction.Log(socketAsync.AcceptSocket.RemoteEndPoint.ToString() + " Connect"); if (IsCanConn != null) { if (IsCanConn((IPEndPoint)socketAsync.AcceptSocket.RemoteEndPoint)) { socketAsync.UserToken = NewRPCUserInfo(socketAsync); return(true); } else { return(false); } } socketAsync.UserToken = NewRPCUserInfo(socketAsync); return(true); }
public void Pause() { Server.Stop(); LogAction.Log("Server is Pause"); }
public void Start() { Server.Start(); LogAction.Log("Server is Start"); }