示例#1
0
 protected override void OnClosed(CloseCause cause)
 {
     base.OnClosed(cause);
     this.RoomClient.RunInMainThread(() => {
         if (this.Room != null)
         {
             this.Room.OnClose();
             this.Room = null;
             this.RoomClient.Callback.OnLeftRoom();
         }
         if (this.JoiningRoom)
         {
             Log.Warn("正在加入房间的时候 房间服务器断开了");
             if (this._onConnectFail != null)
             {
                 this._onConnectFail(new Exception("加入房间时连接断开"));
             }
         }
         if (!this.RoomClient.ToLobbyClient.Connected)
         {
             this.RoomClient.Callback.OnDisconnected(cause);
         }
         this.JoiningRoom = false;
     });
 }
示例#2
0
 public override void Close(CloseCause cause)
 {
     lock (_closeLock) {
         if (this._socket != null)
         {
             OnClosed(cause);
         }
     }
 }
示例#3
0
 protected override void OnClosed(CloseCause cause)
 {
     base.OnClosed(cause);
     this.RoomClient.RunInMainThread(() => {
         this.RoomClient.Callback.OnLeftLobby();
         if (!this.RoomClient.ToRoomClient.Connected)
         {
             this.RoomClient.Callback.OnDisconnected(cause);
         }
     });
 }
示例#4
0
        protected override void OnClosed(CloseCause cause)
        {
            if (this._socket != null)
            {
                base.OnClosed(cause);
#if COREFX
                this._socket.Dispose();
#else
                if (this._socket.Connected)
                {
                    this._socket.Shutdown(SocketShutdown.Both);
                    this._socket.Close(1);
                }
#endif
                lock (this.toSendQueue) {
                    this.toSendQueue.Clear();
                }
                this._socket = null;
            }
        }
示例#5
0
 protected virtual void OnClosed(CloseCause cause)
 {
     this.Log.Debug(GetType().Name + " OnClosed " + cause);
 }
示例#6
0
 public virtual void Close(CloseCause cause)
 {
 }
示例#7
0
 public virtual void OnDisconnected(CloseCause cause)
 {
 }