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

Unexpected connection close #184

Open
kidphys opened this issue Aug 27, 2015 · 7 comments
Open

Unexpected connection close #184

kidphys opened this issue Aug 27, 2015 · 7 comments

Comments

@kidphys
Copy link

kidphys commented Aug 27, 2015

I have a sockjs web-socket server that transfer data continuously to about 1k clients simultaneously. Occasionally, I see that in the client, the web-socket connection is closed and another connection is open. This is undesirable since my data stream is continuous, and anything disruption is critical.

Is this the normal behavior of a web-socket connection that lives very long?

The deployment model is node server behind a nginx proxy.

@brycekahle
Copy link
Contributor

Network disruptions can happen for any number of reasons. Depending upon perfect operation is probably not wise.

@kidphys
Copy link
Author

kidphys commented Aug 28, 2015

I know. However this happens quite frequently, and I'm not sure if there is anything wrong on my config or my code. The network's running pretty much fine.

So this is the common event?

@brycekahle
Copy link
Contributor

Impossible for me to know without data. You should capture the close code and reason.

@kidphys
Copy link
Author

kidphys commented Aug 31, 2015

How should I do that?

There is no error from the server-side. From the client-side, the data stream just stops and our code closes connection 15 secs after the last heartbeat. Basically there's no exception throw.

@brycekahle
Copy link
Contributor

Look for the close or error events on the client and server. If you do maintain a websocket connection the entire time, Chrome lets you inspect the individual frames as well.

@mbratoev
Copy link

I am observing a similar issue when I send relatively long series (e.g. 20-30 frames with length around 88000-90000 bytes) of data packets to upload files from client (sockjs v1.1.1) to the server (vertx v3.3.3). Rather often the close event callback is invoked unexpectedly without any obvious reason. If there is an error I would expect at least my onerror callback to be invoked first. Here is what i have in the close event:

{"type":"close","bubbles":false,"cancelable":false,"timeStamp":1474439661639,"wasClean":false,"code":1000,"reason":""}

Maybe the problem does not have anything to do with the volume of the data being transferred but it is rather easy to reproduce it this way. This also happens when I run the client and the server on one and the same machine.

@brycekahle
Copy link
Contributor

Capturing client and server logs will help debugging here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants