From 4d9769eeb7fdd233d9abbfeb7f64ec5b45c984ba Mon Sep 17 00:00:00 2001 From: oneRain Date: Tue, 23 Jun 2020 16:16:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=AE=80=E5=8C=96=20Connection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Internal/Connection/LCConnection.cs | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Realtime/Realtime/Internal/Connection/LCConnection.cs b/Realtime/Realtime/Internal/Connection/LCConnection.cs index 2e2cb8f..a2022b4 100644 --- a/Realtime/Realtime/Internal/Connection/LCConnection.cs +++ b/Realtime/Realtime/Internal/Connection/LCConnection.cs @@ -54,21 +54,6 @@ namespace LeanCloud.Realtime.Internal.Connection { /// private const string SUB_PROTOCOL = "lc.protobuf2.3"; - /// - /// 通知事件 - /// - internal Action OnNotification; - - /// - /// 断线事件 - /// - internal Action OnDisconnect; - - /// - /// 重连成功事件 - /// - internal Action OnReconnected; - internal string id; /// @@ -190,9 +175,6 @@ namespace LeanCloud.Realtime.Internal.Connection { /// internal async Task Close() { LCRealtime.RemoveConnection(this); - OnNotification = null; - OnDisconnect = null; - OnReconnected = null; heartBeat.Stop(); await ws.Close(); } @@ -277,7 +259,9 @@ namespace LeanCloud.Realtime.Internal.Connection { LCLogger.Debug("Reconnected"); ws.OnMessage = OnClientMessage; ws.OnClose = OnClientDisconnect; - OnReconnected?.Invoke(); + foreach (LCIMClient client in clients.Values) { + client.HandleReconnected(); + } break; } else { // 重置 Router,继续尝试重连