Skip to content

Instantly share code, notes, and snippets.

@fassko
Created July 30, 2019 08:06
Show Gist options
  • Save fassko/5286b483529d36a3fbff180ed1b559a3 to your computer and use it in GitHub Desktop.
Save fassko/5286b483529d36a3fbff180ed1b559a3 to your computer and use it in GitHub Desktop.
Ping/ping with Websockets iOS13
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