private void Reset() { IsTimeout = true; if (_exSocket != null) { try { //设置Socket为Closed的状态, 并未将物理连接马上中断 _exSocket.IsClosed = true; _exSocket.Close(); } catch { } } Guid code; if (_userHash.TryRemove(UserId, out code)) { UnBind(); } if (!string.IsNullOrEmpty(ProxyId)) { _remoteHash.TryRemove(ProxyId, out code); } GameSession session; if (_globalSession.TryRemove(KeyCode, out session)) { session._monitorLock.Clear(); } }
protected override void Dispose(bool disposing) { if (!IsDisposed) { try { socket?.Close(); } finally { base.Dispose(disposing); } } }
public void Close() { _exSocket.Close(); }
public void Close() { socket.Close(); }