Discard 0 keep-alive interval
This commit is contained in:
parent
582ef4875d
commit
ecbad85b4a
@ -578,7 +578,7 @@ public class SessionProxy {
|
||||
return
|
||||
}
|
||||
|
||||
if let interval = configuration.keepAliveInterval {
|
||||
if let interval = configuration.keepAliveInterval, interval > 0 {
|
||||
let elapsed = now.timeIntervalSince(lastPingOut)
|
||||
guard (elapsed >= interval) else {
|
||||
let remaining = min(interval, interval - elapsed)
|
||||
@ -593,7 +593,7 @@ public class SessionProxy {
|
||||
sendDataPackets([DataPacket.pingString])
|
||||
lastPingOut = Date()
|
||||
|
||||
if let interval = configuration.keepAliveInterval {
|
||||
if let interval = configuration.keepAliveInterval, interval > 0 {
|
||||
queue.asyncAfter(deadline: .now() + interval) { [weak self] in
|
||||
self?.ping()
|
||||
}
|
||||
@ -899,7 +899,7 @@ public class SessionProxy {
|
||||
}
|
||||
delegate?.sessionDidStart(self, remoteAddress: remoteAddress, reply: reply)
|
||||
|
||||
if let interval = configuration.keepAliveInterval {
|
||||
if let interval = configuration.keepAliveInterval, interval > 0 {
|
||||
queue.asyncAfter(deadline: .now() + interval) { [weak self] in
|
||||
self?.ping()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user