work on fixing reconnect()
This commit is contained in:
parent
76a572e735
commit
596a499041
@ -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 {
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user