joyent/node — Issue #2114: socket.setTimeout is ignored after HTTP upgrade
Author: acertainsomeone
Created: 2011-11-15 10:55:22+00:00
State: open

I did a basic WebSocket implementation on my own, which involves upgrading a HTTP connection. Node seems to set up a 2 minute idle timeout for these connections, which I guess is the default behavior for HTTP connections.

My connections can be idle for quite some time, so I wanted to disable this timeout. I tried
```socket.setTimeout(0);```
but that's totally getting ignored. The 'socket' object is fine -- immediately after this line I appended a listener for the 'timeout' event to it (for debugging purposes) and that worked.

Even more, not only does the 'timeout' event fire, it also closes the connection. I can prevent this by doing
```socket.removeAllListeners('timeout');```
but that's just a workaround.

Is this a bug or am I doing something wrong? Is there another way to disable that timeout?