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; }); }
public override void Close(CloseCause cause) { lock (_closeLock) { if (this._socket != null) { OnClosed(cause); } } }
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); } }); }
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; } }
protected virtual void OnClosed(CloseCause cause) { this.Log.Debug(GetType().Name + " OnClosed " + cause); }
public virtual void Close(CloseCause cause) { }
public virtual void OnDisconnected(CloseCause cause) { }