You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If in one of these states then part of the connection, reconnection, or explicit
55
+
// disconnection process is underway, so do nothing
56
+
return
57
+
case.disconnected:
58
+
// If already disconnected then reset connection and try to reconnect, provided the
59
+
// state isn't disconnected because of an intentional disconnection
60
+
if !self!.intentionalDisconnect {self!.resetConnectionAndAttemptReconnect()}
61
+
return
62
+
case.connected:
63
+
// If already connected then we assume that there was a missed network event that
64
+
// led to a bad connection so we move to the disconnected state and then attempt
65
+
// reconnection
52
66
self!.delegate?.debugLog?(
53
-
message:"[PUSHER DEBUG] Connection state is \(self!.connectionState.stringValue()) so not calling attemptReconnect"
67
+
message:"[PUSHER DEBUG] Connection state is \(self!.connectionState.stringValue())but received network reachability change so going to call attemptReconnect"
54
68
)
69
+
self!.resetConnectionAndAttemptReconnect()
55
70
return
56
71
}
57
-
58
-
self!.attemptReconnect()
59
72
}
60
73
reachability?.whenUnreachable ={[weak self] reachability in
61
74
guardself!=nilelse{
@@ -64,7 +77,7 @@ public typealias PusherEventJSON = [String: AnyObject]
0 commit comments