facebookincubator / SocketRocket

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

Close Status Code #170

Closed JEphron closed 10 years ago

JEphron commented 10 years ago

I was having some issues getting SocketRocket to work with my chosen websocket server library, and when I traced the problem it turned out that the server was crashing on an unhandled error code. It looks like SocketRocket sends a -1 when closing a connection. I can't find any mention of this as an accepted status code in the RFC spec. I don't know if this is a real issue, I may have overlooked something in the spec. Just thought I would bring it up here.

JEphron commented 10 years ago

Just noticed that I can manually send a valid closing code with the closeWithCode method. Is it intended behavior that simply calling close results in a status code of -1?

iheart2code commented 10 years ago

I think I ran into this as well. The error code should be 1000, per 7.4.1 of the RFC 6455 protocol specification for WebSocket. http://tools.ietf.org/html/rfc6455#section-7.4.1

On Sun, May 11, 2014 at 4:44 PM, JEphron notifications@github.com wrote:

Just noticed that I can manually send a valid closing code with the closeWithCode method. Is it intended behavior that simply calling closeresults in a status of -1?

— Reply to this email directly or view it on GitHubhttps://github.com/square/SocketRocket/issues/170#issuecomment-42787254 .

pizthewiz commented 10 years ago

Duplicate of issue #127, PR to resolve in #157.

JakeWharton commented 10 years ago

Fixed on master.