Skip to content

Commit 283644b

Browse files
committed
fix #110 calling close while trying to reconnect
1 parent 8468971 commit 283644b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SocketIOClientSwift/SocketIOClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
481481

482482
// We lost connection and should attempt to reestablish
483483
@objc private func tryReconnect() {
484-
if reconnectAttempts != -1 && currentReconnectAttempt + 1 > reconnectAttempts {
484+
if reconnectAttempts != -1 && currentReconnectAttempt + 1 > reconnectAttempts || !reconnects {
485485
didDisconnect("Reconnect Failed")
486486
return
487487
} else if connected {

0 commit comments

Comments
 (0)