private void CloseSession(TcpSocketSession session) { TcpSocketSession sessionToBeThrowAway; _sessions.TryRemove(session.SessionKey, out sessionToBeThrowAway); session?.Close();// parent server close session }
public void CloseSession(string sessionKey) { TcpSocketSession session = null; if (_sessions.TryGetValue(sessionKey, out session)) { session.Close(); // parent server close session by session-key } }