Skip to content

Instantly share code, notes, and snippets.

@samsonradu
Created June 22, 2013 16:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save samsonradu/1b0c6feb438f5a53e30e to your computer and use it in GitHub Desktop.
Save samsonradu/1b0c6feb438f5a53e30e to your computer and use it in GitHub Desktop.
[19:41] <raduu> http://stackoverflow.com/questions/17245881/node-js-econnreset so any thoughts for this?
[19:42] <@tjfontaine> raduu: you need to add an on('error') for the client
[19:42] <raduu> on the client side js
[19:42] <raduu> ?
[19:42] <@tjfontaine> no on the server side
[19:42] <@tjfontaine> the client that comes to you in the on connection handler
[19:43] <raduu> https://gist.github.com/samsonradu/4cb024fa4c67b35c5a9b
[19:43] <raduu> like this?
[19:43] <@tjfontaine> the client disappears, and you're trying to write/read from it, which is an error case, but you have no error handler configured so it's throwing
[19:44] <@tjfontaine> raduu: more or less
[19:44] <raduu> and do I have to call a disconnect? or something like that
[19:44] <raduu> or this is enough not to propagate it to process
[19:44] <@tjfontaine> that will be enough such that it doesn't end up in uncaughtException handler
[19:44] <@tjfontaine> but
[19:44] <@tjfontaine> you should still do something appropriate for your application logic
[19:45] <raduu> right, like kicking the socket
[19:45] <@tjfontaine> because there's no recovering by the time you reach this point
[19:45] <raduu> what do you suggest?
[19:46] <@tjfontaine> raduu: dunno, it's very application specific
[19:47] <raduu> ok, first step is to stop the crash and see the error caught there
[19:47] <raduu> then I ll move forward to finding the cause
[19:47] <@tjfontaine> the error will still be econnreset -- the connection is gone
[19:49] <@tjfontaine> what induces that behavior in the remote client, who knows, but there are plenty of scenarios where that's out of your control -- the internet is a series of tubes, and sometimes they spring a leak
[19:49] <raduu> I know, I have a staging server and I never ever could reproduce it
[19:49] <raduu> pulling the cable..using IE8.. crashing flash
[19:50] <raduu> ok, I ll deploy the hotfix and let you know
[19:50] <raduu> thanks a lot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment