You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connecting to a server while it is down, mistyped url, or no internet connection does not result in an error. The WebSocket does not emit any event to inform its delegate that the connection failed. I found that urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) is not implemented in NativeEngine. This is the place where those errors are fired.
Steps to Reproduce
Detailed steps to reproduce the problematic behavior:
// not an existing url
var request = URLRequest(url: URL(string: "wss://socket.test.k2.nl/match/2xj5crhn5vhy6vmys0stkqi3s8")!)
request.setValue(url.host, forHTTPHeaderField: "Host")
webSocket = WebSocket(request: request)
webSocket.onEvent = { event in
print(event)
}
webSocket.connect()
run this code and break on print(event) this will not be triggered
disabling internet connection and connecting to a valid url will also not trigger an event
Expected behavior
Connecting to an unreachable server should trigger an error event.
Environment:
OS/Version: iOS 14.4
Starscream Version: 4.0.4
Xcode version: 12.5
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
We also encounter this problem,I found the Starscream use NWConnection,when use unreachable URL, the NWConnection does not call it's handler, below code in WebSocket.swift:
Describe the bug
Steps to Reproduce
print(event)
this will not be triggeredExpected behavior
Environment:
Additional context
The text was updated successfully, but these errors were encountered: