Skip to content

Stream end encountered #92

Closed
Closed
@kevinvavelin

Description

@kevinvavelin

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

Kyrynos commented on Jun 2, 2014

@Kyrynos

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

Kyrynos commented on Jun 2, 2014

@Kyrynos

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

Kyrynos commented on Jun 2, 2014

@Kyrynos

I just figured it out so never mind guys.... sorry ^^

sathishS6G

sathishS6G commented on Aug 8, 2014

@sathishS6G

Hey Kyrynos,

Could you help me to figure out the same issue which you faced??

Kyrynos

Kyrynos commented on Aug 8, 2014

@Kyrynos

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

sathishS6G commented on Aug 20, 2014

@sathishS6G

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

dfed commented on Sep 18, 2015

@dfed
Contributor

Doing some housekeeping. Please reopen if still relevant

mikeKane

mikeKane commented on May 17, 2016

@mikeKane

Im seeing close with code 0 as well. What would cause the error code 0?

michaelluk

michaelluk commented on May 27, 2016

@michaelluk

@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

manish-1988 commented on Jul 19, 2016

@manish-1988

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

gitkong commented on Sep 20, 2016

@gitkong

same problem :Closed Reason:Stream end encountered code = 1001,i dont know how to do now

mobilestar2015

mobilestar2015 commented on Oct 19, 2016

@mobilestar2015

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

gunjot-mansa commented on Oct 22, 2016

@gunjot-mansa

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

protspace commented on Jan 13, 2017

@protspace

I am facing the same issue

17 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @maxhawkins@dfed@notedit@kevinvavelin@michaelluk

        Issue actions

          Stream end encountered · Issue #92 · facebookincubator/SocketRocket