facebookincubator / SocketRocket

A conforming Objective-C WebSocket client library.
Other
9.54k stars 2.01k forks source link

Open Error #670

Open mazhar27 opened 11 months ago

mazhar27 commented 11 months ago

Hello, I am facing this weird issue when I connect web sockets it got connected and I start receiving messages also I got this webSocketDidOpen callback but when I send message I got this error Error Domain=SRWebSocketErrorDomain Code=2134 "Invalid State: Cannot call sendString:error: until connection is open." UserInfo={NSLocalizedDescription=Invalid State: Cannot call sendString:error: until connection is open.} getting this error while se sending data I checked everything my socket is always in connecting state and I am able to receive messages but not able to send

DaverZhou commented 10 months ago

how to solve it?

mazhar27 commented 10 months ago

how to solve it?

It was weird as the instance of socket we are getting in webSocketDidOpen callback is open and I just set my instance to that one and its working fine

sjkummer commented 10 months ago

I also saw this in production. But it's not easy to reproduce