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
55
// disconnection process is underway, so do nothing
56
56
return
57
57
case.disconnected:
58
58
// If already disconnected then reset connection and try to reconnect, provided the
59
59
// state isn't disconnected because of an intentional disconnection
60
-
if !self!.intentionalDisconnect {self!.resetConnectionAndAttemptReconnect()}
60
+
if !strongSelf.intentionalDisconnect {strongSelf.resetConnectionAndAttemptReconnect()}
61
61
return
62
62
case.connected:
63
63
// If already connected then we assume that there was a missed network event that
64
64
// led to a bad connection so we move to the disconnected state and then attempt
65
65
// reconnection
66
-
self!.delegate?.debugLog?(
66
+
strongSelf.delegate?.debugLog?(
67
67
message:"[PUSHER DEBUG] Connection state is \(self!.connectionState.stringValue()) but received network reachability change so going to call attemptReconnect"
68
68
)
69
-
self!.resetConnectionAndAttemptReconnect()
69
+
strongSelf.resetConnectionAndAttemptReconnect()
70
70
return
71
71
}
72
72
}
73
73
reachability?.whenUnreachable ={[weak self] reachability in
74
-
guardself!=nilelse{
74
+
guardlet strongSelf =selfelse{
75
75
print("Your Pusher instance has probably become deallocated. See https://github.com/pusher/pusher-websocket-swift/issues/109 for more information")
0 commit comments