Created
July 30, 2019 08:06
-
-
Save fassko/5286b483529d36a3fbff180ed1b559a3 to your computer and use it in GitHub Desktop.
Ping/ping with Websockets iOS13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sendPing() { | |
webSocketTask.sendPing { (error) in | |
if let error = error { | |
print("Sending PING failed: \(error)") | |
} | |
DispatchQueue.main.asyncAfter(deadline: .now() + 10) { | |
self.sendPing() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment