facebookincubator / SocketRocket

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

SocketRocket client with a Daphne websocket server disconnecting websocket on client side #511

Open yabenatti opened 7 years ago

yabenatti commented 7 years ago

I am developing an iOS app in Objective-C, on XCode Version 8.2.1 and I'm using SocketRocket through cocoapods.

update: My backend uses Daphne (1.1.0), cloudflare and nginx (1.10.2). So the calls are done like it follows: User -> CF -> Nginx -> Daphne

After successfully connecting and receiving data from the websocket, the connection is closed with the reason "Stream end encountered". It doesn't happen every time I connect with the websocket though. The output of the method "(void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:" is as it follows:

"WebSocket closed reason: Stream end encountered and code: 1001 and was clean: 0"

Have someone had that problem before?

RomanGal commented 7 years ago

I have the similar issue. In my case, I'm handling socket connection unproperly on the client side.