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**
|
/// **You shouldn't call this directly**
|
||||||
open func doFastUpgrade() {
|
open func doFastUpgrade() {
|
||||||
|
|
||||||
if waitingForPoll {
|
if waitingForPoll {
|
||||||
DefaultSocketLogger.Logger.error("Outstanding poll when switched to WebSockets," +
|
DefaultSocketLogger.Logger.error("Outstanding poll when switched to WebSockets," +
|
||||||
"we'll probably disconnect soon. You should report this.", type: SocketEngine.logType)
|
"we'll probably disconnect soon. You should report this.", type: SocketEngine.logType)
|
||||||
@ -374,7 +373,8 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
|||||||
flushProbeWait()
|
flushProbeWait()
|
||||||
|
|
||||||
// Need to flush postWait to socket since it connected successfully
|
// 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 {
|
if !postWait.isEmpty {
|
||||||
flushWaitingForPostToWebSocket()
|
flushWaitingForPostToWebSocket()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,7 +168,6 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
|||||||
DefaultSocketLogger.Logger.log("Adding engine", type: SocketManager.logType)
|
DefaultSocketLogger.Logger.log("Adding engine", type: SocketManager.logType)
|
||||||
|
|
||||||
engine?.engineQueue.sync {
|
engine?.engineQueue.sync {
|
||||||
|
|
||||||
self.engine?.client = nil
|
self.engine?.client = nil
|
||||||
|
|
||||||
// Close old engine so it will not leak because of URLSession if in polling mode
|
// Close old engine so it will not leak because of URLSession if in polling mode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user