We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 413e94e commit ee97b42Copy full SHA for ee97b42
Sources/Extensions/PusherConnection+WebsocketDelegate.swift
@@ -229,5 +229,23 @@ extension PusherConnection: WebSocketConnectionDelegate {
229
context: """
230
Error: \(error.debugDescription)
231
""")
232
+
233
+ // Resetting connection if we receive another POSIXError
234
+ // than ENOTCONN (57 - Socket is not connected)
235
+ if case .posix(let code) = error, code != .ENOTCONN {
236
+ resetConnection()
237
238
+ guard !intentionalDisconnect else {
239
+ Logger.shared.debug(for: .intentionalDisconnection)
240
+ return
241
+ }
242
243
+ guard reconnectAttemptsMax == nil || reconnectAttempts < reconnectAttemptsMax! else {
244
+ Logger.shared.debug(for: .maxReconnectAttemptsLimitReached)
245
246
247
248
+ attemptReconnect()
249
250
}
251
0 commit comments