fix socketio/socket.io-client-swift#110 calling close while trying to reconnect

This commit is contained in:
Erik 2015-07-03 13:53:40 -04:00
parent 846897157c
commit 283644b75c

View File

@ -481,7 +481,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
// We lost connection and should attempt to reestablish // We lost connection and should attempt to reestablish
@objc private func tryReconnect() { @objc private func tryReconnect() {
if reconnectAttempts != -1 && currentReconnectAttempt + 1 > reconnectAttempts { if reconnectAttempts != -1 && currentReconnectAttempt + 1 > reconnectAttempts || !reconnects {
didDisconnect("Reconnect Failed") didDisconnect("Reconnect Failed")
return return
} else if connected { } else if connected {