diff options
author | Kalev Lember <kalevlember@gmail.com> | 2013-03-25 11:47:10 (GMT) |
---|---|---|
committer | Kalev Lember <kalevlember@gmail.com> | 2013-03-25 11:47:10 (GMT) |
commit | c65c95bf203ecd80923b5581f97db980d08ab807 (patch) | |
tree | 4575ac860838b9826e6bea2f692966096f078810 | |
parent | 7bc51bf8476e4546efaf28b90399e8a0280ac71f (diff) | |
download | powwow-c65c95bf203ecd80923b5581f97db980d08ab807.zip powwow-c65c95bf203ecd80923b5581f97db980d08ab807.tar.gz powwow-c65c95bf203ecd80923b5581f97db980d08ab807.tar.bz2 |
Enable TCP keep-alive
-rw-r--r-- | tcp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -226,6 +226,10 @@ int tcp_connect __P2 (char *,addr, int,port) if (setsockopt(newtcp_fd, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt))) errmsg("setsockopt(TCP_NODELAY) failed"); + /* TCP keep-alive */ + if (setsockopt(newtcp_fd, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt))) + errmsg("setsockopt(SO_KEEPALIVE) failed"); + /* * Then, close-on-exec: * we don't want children to inherit the socket! |