joyent/libuv — pull request #729 by fastest963 (2013-03-01 05:38:10+00:00)
Title: Add interval and count to keep-alive

The default probe interval and failure counts set by the OS are way too extreme and if you have a real-time socket server, you're going to want to customize these so you can have a much lower keep-alive interval and count so you're notified of disconnected sockets sooner.

Unfortunately, Windows doesn't let you set count, but using SIO_KEEPALIVE_VALS we can set interval (see: http://msdn.microsoft.com/en-us/library/windows/desktop/dd877220(v=vs.85).aspx). The defaults for the OS are 2 hour timeouts and 1 second intervals. I was hesitant about raising the default 1 second because that's pretty insane but decided to leave it at default.