Clarify comments to explain why we did the move
This commit is contained in:
parent
f7ccf338ad
commit
5fdff65281
@ -359,7 +359,6 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
///
|
||||
/// **You shouldn't call this directly**
|
||||
open func doFastUpgrade() {
|
||||
|
||||
if waitingForPoll {
|
||||
DefaultSocketLogger.Logger.error("Outstanding poll when switched to WebSockets," +
|
||||
"we'll probably disconnect soon. You should report this.", type: SocketEngine.logType)
|
||||
@ -372,9 +371,10 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
fastUpgrade = false
|
||||
probing = false
|
||||
flushProbeWait()
|
||||
|
||||
|
||||
// Need to flush postWait to socket since it connected successfully
|
||||
// (moved from flushProbeWait() since it is also called on connected failure)
|
||||
// moved from flushProbeWait() since it is also called on connected failure, and we don't want to try and send
|
||||
// packets through WebSockets when WebSockets has failed!
|
||||
if !postWait.isEmpty {
|
||||
flushWaitingForPostToWebSocket()
|
||||
}
|
||||
|
||||
@ -168,9 +168,8 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
DefaultSocketLogger.Logger.log("Adding engine", type: SocketManager.logType)
|
||||
|
||||
engine?.engineQueue.sync {
|
||||
|
||||
self.engine?.client = nil
|
||||
|
||||
|
||||
// Close old engine so it will not leak because of URLSession if in polling mode
|
||||
self.engine?.disconnect(reason: "Adding new engine")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user