bumptech/stud — pull request #43 by dpaneda (2011-10-20 11:35:25+00:00)
Title: Patch to set SO_KEEPALIVE on client socket

The connection with the cliend does not use SO_KEEPALIVE.

The problem with that is that sometimes client connection can terminate in a total silently way. For example, a client can send a RST packet which get lost on the network and stud will never close the conn. When a lot of connections are being done through stud, this leads to an increasing number of open connections and memory used both in kernel and stud.

With this patch, we set the keepalive option on this socket to avoid the problem. The default for the Keepalive is 3600 seconds, but it can be changed with a new option (-k).