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

View File

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