work on fixing reconnect()

This commit is contained in:
Erik 2016-03-11 13:41:09 -05:00
parent 76a572e735
commit 596a499041
2 changed files with 7 additions and 1 deletions

View File

@ -301,6 +301,10 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
client?.engineDidClose(reason) client?.engineDidClose(reason)
} }
if closed {
return postSendClose(nil, nil, nil)
}
DefaultSocketLogger.Logger.log("Engine is being closed.", type: logType) DefaultSocketLogger.Logger.log("Engine is being closed.", type: logType)
if websocket { if websocket {

View File

@ -423,7 +423,9 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
/// Tries to reconnect to the server. /// Tries to reconnect to the server.
public func reconnect() { public func reconnect() {
tryReconnectWithReason("manual reconnect") guard !reconnecting else { return }
engine?.disconnect("manual reconnect")
} }
/// Removes all handlers. /// Removes all handlers.