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

Disconnect not being detected #9

Open
TomMettam opened this issue May 30, 2014 · 1 comment
Open

Disconnect not being detected #9

TomMettam opened this issue May 30, 2014 · 1 comment

Comments

@TomMettam
Copy link

Running as a server.

In the case where the remote client disappears (i.e, the connection doesn't get explicitly closed) the SSE client remains active indefinitely, with no disconnect events being fired.

To reproduce:

  1. Start an SSE server using this module.
  2. Connect to the eventsource from a mobile device (I used an android tablet)
  3. After connecting, turn off WiFi
  4. Observe that even after the tcp_keepalive_time has expired, and even after sending regular "keepalive" packets to the client, the connection never registers as dropped, resulting in a leak.
@psturm51
Copy link

In the file, sseclient.js, in SSEClient constructor, you will see a line hooking the res (responses) close event to the close event. This should be changed to the req (request) close event:

req.on('close',function(){
self.emit("close");
});

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

2 participants