New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream end encountered #92
Comments
Hello guys, I experience this end of stream problem, immediately after the stream logs that it is connected, for no particular reason. I am trying to create an app for my own purpose by reverse engineering method as I don't know the server environment.. but I have a working javascript code for establishing a connection from node.js. I just tried to rewrite that script into Obj-C and I couldn't find anything that might be special for that script... All I know is that the server runs on tornado. I also tried to implement serverID and sessionID but I don't know whether the SRWebSocket does that itself. Anyway, it didn't make any change in the result. The log is: sometimes it ends with code: 1000 and wasClean: true |
Oh, I just found out that my implementation of SESSION is wrong.. (I just put the session string into the URL..lol..) But still I don't know whether the SR implements it itself.. I suppose, it does not because I set up a tornado app for testing purpose and if I make a connection from browser, the path is: /chat/008/ap6ueego/websocket and from iPhone Simulator just: /chat/websocket so I assume that's why my stream ends. Can anyone help me with this? |
I just figured it out so never mind guys.... sorry ^^ |
Hey Kyrynos, Could you help me to figure out the same issue which you faced?? |
What kind of issue you are facing? Are you able to establish the connection? To implement the session in the URL I use: If the connection is established and then it get DCed for no reason like after sending some piece of data to it - check what are you sending.. That was the problem in my case - I was sending JSON data after establishing my connection but the server was expecting JSON data with some special prefix so that was the reason for getting cut off. Hopefully it will help you with your issue. |
Thanks for the update. Once, I am connected, i am sending a JSON to server, which also expecting the same, I can able to see my JSON Parameters in server too. Immediately my client is disconnected forcefully by the reason its saying, Stream and encountered. |
Doing some housekeeping. Please reopen if still relevant |
Im seeing close with code 0 as well. What would cause the error code 0? |
@kevinvavelin Have you figured out what's the problem? I am using the same framework(https://github.com/pkyeck/socket.IO-objc) as you did and could you give me some hints on how you solve the problem? I am getting the weird NSStreamEventEndEncountered and the websocket disconnected with error after few rounds of normal communication with my server. Thanks :) |
I am getting the same error
|
same problem :Closed Reason:Stream end encountered code = 1001,i dont know how to do now |
Same problem. Stream end encountered code = 1001,. |
I am facing the same issue "didCloseWithCode --> 1001 and reason ==> Stream end encountered", but only while using 4G connection. It works perfect with my wifi! I am also using this with kurento-ios. |
I am facing the same issue |
For me, only working solution was to send ping to server after every second to sustain connection in case using 4G. |
i am faceing this problom, my python websocekt client can work well. |
Code:1001 |
Code:1001 |
when connect Socket.io , you should append "/socket.io/?EIO=4&transport=websocket", good luck! |
when connect Socket.io , you should append "ws://ip:port/socket.io/?EIO=4&transport=websocket", good luck! |
@qbshen Wow! It works to me! Thank you. BTW, Where this option from? and What does this option doing for Connection? Please give me any hint. |
@qbshen My error was
Using My logs
|
I faced the same issue today, and I figured out that it was because I didn't specify sub protocols, which caused server closing the connection. |
@Piasy I met the same issue. Could you please tell me which sub protocols do you specify? |
I was connecting to Janus Gateway's via websocket, it need set |
俺也一样 |
俺也一样的问题,拼接了也不好使。有没有其他的解决办法 |
Any help on this? Not using sockeet io. Using react native websockets |
Me too : ( |
I solved this issue by sending a keepalive ping every once in a while. My WebSocket connection was proxied through nginx which times out the WebSocket after 60 seconds without receiving a message. From React Native: setInterval(() => ws.ping(), 30000); |
Hi there,
I see there is another thread called like mine which is closed (#82) but I've the same issue with the use of this project (https://github.com/pkyeck/socket.IO-objc).
The stream closed after a connexion with Facebook, where I send my accessToken and many data to my socket.io server and when I get my data back and do nothing else, my connexion closed.
Can you help me with ?
The text was updated successfully, but these errors were encountered: