Exemple #1
0
        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();
            }
        }
Exemple #2
0
 protected override void Dispose(bool disposing)
 {
     if (!IsDisposed)
     {
         try
         {
             socket?.Close();
         }
         finally
         {
             base.Dispose(disposing);
         }
     }
 }
Exemple #3
0
 public void Close()
 {
     _exSocket.Close();
 }
Exemple #4
0
 public void Close()
 {
     socket.Close();
 }