Set SO_KEEPALIVE on client sockets if configured to do so.

This commit is contained in:
antirez
2013-02-08 16:40:59 +01:00
parent f2817cbd9e
commit 2ed3fc1502
4 changed files with 14 additions and 0 deletions

View File

@ -59,6 +59,8 @@ redisClient *createClient(int fd) {
if (fd != -1) {
anetNonBlock(NULL,fd);
anetEnableTcpNoDelay(NULL,fd);
if (server.tcpkeepalive)
anetKeepAlive(NULL,fd,server.tcpkeepalive);
if (aeCreateFileEvent(server.el,fd,AE_READABLE,
readQueryFromClient, c) == AE_ERR)
{