Ping relays on resume, if there's an error then try to reconnect

This is an attempt to fix the fail-to-reconnect issues. Let's see if it works.
This commit is contained in:
William Casarin
2023-05-07 10:28:36 -07:00
parent f78eeb1f22
commit 84174ef9ad
4 changed files with 49 additions and 4 deletions

View File

@@ -32,6 +32,10 @@ final class WebSocket: NSObject, URLSessionWebSocketDelegate {
self.session = session
}
func ping(receiveHandler: @escaping (Error?) -> Void) {
self.webSocketTask.sendPing(pongReceiveHandler: receiveHandler)
}
func connect() {
resume()
}