This commit is contained in:
Erik Little 2017-11-08 08:17:36 -05:00
parent 099c379272
commit ff0f1c8c77
No known key found for this signature in database
GPG Key ID: 62F837E56F4E9320

View File

@ -563,8 +563,11 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
pongsMissed += 1 pongsMissed += 1
write("", withType: .ping, withData: []) write("", withType: .ping, withData: [])
engineQueue.asyncAfter(deadline: DispatchTime.now() + .milliseconds(pingInterval)) {[weak self] in engineQueue.asyncAfter(deadline: DispatchTime.now() + .milliseconds(pingInterval)) {[weak self, id = self.sid] in
self?.sendPing() // Make sure not to ping old connections
guard let this = self, this.sid == id else { return }
this.sendPing()
} }
} }