Closed
Description
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 ?
Activity
Kyrynos commentedon Jun 2, 2014
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:
[522:60b] Websocket Connected
[522:60b] WebSocket Closed
code: 0
reason: Stream end encountered
wasClean: 0
sometimes it ends with code: 1000 and wasClean: true
Kyrynos commentedon Jun 2, 2014
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?
Kyrynos commentedon Jun 2, 2014
I just figured it out so never mind guys.... sorry ^^
sathishS6G commentedon Aug 8, 2014
Hey Kyrynos,
Could you help me to figure out the same issue which you faced??
Kyrynos commentedon Aug 8, 2014
What kind of issue you are facing? Are you able to establish the connection?
To implement the session in the URL I use:
NSString *url = [NSString stringWithFormat:@"https://yourhost/its_endpoint/%i/%@/websocket", arc4random_uniform(999), [(NSString *)[[NSUUID UUID] UUIDString] lowercaseString]];
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.
sathishS6G commentedon Aug 20, 2014
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.
dfed commentedon Sep 18, 2015
Doing some housekeeping. Please reopen if still relevant
mikeKane commentedon May 17, 2016
Im seeing close with code 0 as well. What would cause the error code 0?
michaelluk commentedon May 27, 2016
@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 :)
manish-1988 commentedon Jul 19, 2016
I am getting the same error
2016-07-19 14:15:03.901 VideoCallingAppRTC[315:21955] WebSocket closed with code: 1001 reason:Stream end encountered wasClean:0 2016-07-19 14:15:03.901 VideoCallingAppRTC[315:21955] C->RS: BYE 2016-07-19 14:15:03.901 VideoCallingAppRTC[315:21955] url = https://apprtc.appspot.com/leave/gsdtest103/52754944 Disconnected! 2016-07-19 14:15:05.084 VideoCallingAppRTC[315:21955] Unregistered from room server.
gitkong commentedon Sep 20, 2016
same problem :Closed Reason:Stream end encountered code = 1001,i dont know how to do now
mobilestar2015 commentedon Oct 19, 2016
Same problem. Stream end encountered code = 1001,.
I am getting this error while testing Kurento-iOS, it's closed while sending icecandidates to the server.
I can't figure out the reason. Please help me.
gunjot-mansa commentedon Oct 22, 2016
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.
protspace commentedon Jan 13, 2017
I am facing the same issue
17 remaining items