rename method
This commit is contained in:
parent
b919d3e411
commit
cb0a6f5460
@ -163,7 +163,7 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func closeOutSocket() {
|
private func closeOutEngine() {
|
||||||
sid = ""
|
sid = ""
|
||||||
closed = true
|
closed = true
|
||||||
invalidated = true
|
invalidated = true
|
||||||
@ -276,19 +276,19 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func disconnect(reason: String) {
|
public func disconnect(reason: String) {
|
||||||
guard connected else { return closeOutSocket() }
|
guard connected else { return closeOutEngine() }
|
||||||
|
|
||||||
DefaultSocketLogger.Logger.log("Engine is being closed.", type: logType)
|
DefaultSocketLogger.Logger.log("Engine is being closed.", type: logType)
|
||||||
|
|
||||||
if closed {
|
if closed {
|
||||||
closeOutSocket()
|
closeOutEngine()
|
||||||
client?.engineDidClose(reason)
|
client?.engineDidClose(reason)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if websocket {
|
if websocket {
|
||||||
sendWebSocketMessage("", withType: .Close, withData: [])
|
sendWebSocketMessage("", withType: .Close, withData: [])
|
||||||
closeOutSocket()
|
closeOutEngine()
|
||||||
} else {
|
} else {
|
||||||
disconnectPolling()
|
disconnectPolling()
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
|||||||
self.postWait.append(String(SocketEnginePacketType.Close.rawValue))
|
self.postWait.append(String(SocketEnginePacketType.Close.rawValue))
|
||||||
let req = self.createRequestForPostWithPostWait()
|
let req = self.createRequestForPostWithPostWait()
|
||||||
self.doRequest(req) {_, _, _ in }
|
self.doRequest(req) {_, _, _ in }
|
||||||
self.closeOutSocket()
|
self.closeOutEngine()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user