I'm trying to communicate with my server using web sockets (URLSession, URLSessionWebSocketTask)
When the server has an internal error and closes the connection, I don't get anything here in Swift on the client side. I've got a chain of Combine Publishers and I end up timing them out after 60 seconds.
Shouldn't the .failure path get called if the connection goes down? Is there another way to get that error when it happens, without waiting for the timeout?
Code Block swift let task = URLSession.shared.webSocketTask(with: url) task.send(.data(...)) { ... } task.receive { result in switch result { case .success(let message): ... case .failure(let error): ...
When the server has an internal error and closes the connection, I don't get anything here in Swift on the client side. I've got a chain of Combine Publishers and I end up timing them out after 60 seconds.
Shouldn't the .failure path get called if the connection goes down? Is there another way to get that error when it happens, without waiting for the timeout?