Send close reason to engine
This commit is contained in:
parent
c211ab140d
commit
ec2aa703a3
@ -215,19 +215,19 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
|
|||||||
reconnects = false
|
reconnects = false
|
||||||
|
|
||||||
// Make sure the engine is actually dead.
|
// Make sure the engine is actually dead.
|
||||||
engine?.close("Client closed")
|
engine?.close(reason)
|
||||||
handleEvent("disconnect", data: [reason], isInternalMessage: true)
|
handleEvent("disconnect", data: [reason], isInternalMessage: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Closes the socket. Only reopen the same socket if you know what you're doing.
|
Disconnects the socket. Only reconnect the same socket if you know what you're doing.
|
||||||
Will turn off automatic reconnects.
|
Will turn off automatic reconnects.
|
||||||
*/
|
*/
|
||||||
public func disconnect() {
|
public func disconnect() {
|
||||||
DefaultSocketLogger.Logger.log("Closing socket", type: logType)
|
DefaultSocketLogger.Logger.log("Closing socket", type: logType)
|
||||||
|
|
||||||
reconnects = false
|
reconnects = false
|
||||||
didDisconnect("Closed")
|
didDisconnect("Disconnect")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user