Skip to content
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

Websocket ignores voluntarily connection closure on android #1356

Closed
dbuschtoens opened this issue May 24, 2017 · 1 comment
Closed

Websocket ignores voluntarily connection closure on android #1356

dbuschtoens opened this issue May 24, 2017 · 1 comment

Comments

@dbuschtoens
Copy link
Contributor

dbuschtoens commented May 24, 2017

When a WebSocket connection is closed cleanly by the other peer, no close event is raised on the WebSocket and the connection state remains on "OPEN" although it is actually closed. Attempting to send any data in this state has no effect.

An easy way of reproducing this behaviour is by starting the web-socket example after modifying the supplied chat server by adding connection.close(); in the "message" event.

On iOS, the close event is raised correctly with wasClean = true and code = 1000.

Additionally, closing the chat-server raises a "ECONNRESET (Connection reset by peer)" error and a close event with error code 1006, which indicates that no close control frame was received, on Android. On iOS, no error event is raised and the close event has the error code 1001

@mpost
Copy link
Member

mpost commented Jun 1, 2017

We have fixed the problem in the Android side by forwarding the closing event to the js side and to correctly send the close code 1000 to the server.

I am a bit confused why closing the connection to an ios client on the server side would print 1001 on the server. The code printed should be the code provided in the connection.close(1000, 'default message') method. When no code and message is given 1000 is assumed.

@mpost mpost closed this as completed Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants