I keep receiving viabilityChanged event whenever I try to connect to websocket.
Steps to Reproduce
It happens after connection request. Event I receive is viabilityChanged
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocketClient) {
switch event {
case .connected:
isConnected = true
if let message = messageInQueue {
send(message)
messageInQueue = nil
}
case .disconnected, .cancelled, .peerClosed:
isConnected = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.socket.connect()
}
case .text(let string):
do {
let decoder = JSONDecoder()
let response = try decoder.decode(T.self, from: Data(string.utf8))
if let mil = response as? MilistreamTickers, mil.hasQuoteWithProperties {
self.subject.send(response)
}
} catch {
print("Unavailable", string)
}
case .binary, .pong, .ping, .error, .viabilityChanged, .reconnectSuggested:
break
}
}
Expected behavior
I have same code base for months now and I expect web socket to connect as it was so far.
But today I keep getting different event and no connection is established.
Describe the bug
I keep receiving viabilityChanged event whenever I try to connect to websocket.
Steps to Reproduce
It happens after connection request. Event I receive is viabilityChanged
Expected behavior
I have same code base for months now and I expect web socket to connect as it was so far. But today I keep getting different event and no connection is established.
Environment: