diff options
Diffstat (limited to 'lib/sockopt.h')
| -rw-r--r-- | lib/sockopt.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/sockopt.h b/lib/sockopt.h index 6c80841e3c..694edf7638 100644 --- a/lib/sockopt.h +++ b/lib/sockopt.h @@ -153,6 +153,28 @@ extern int sockopt_tcp_mss_set(int sock, int tcp_maxseg); * Socket to get max segement size. */ extern int sockopt_tcp_mss_get(int sock); + +/* + * Configure TCP keepalive for a given socket + * + * sock + * Socket to enable keepalive option on. + * + * keepalive_idle + * number of seconds a connection needs to be idle + * before sending out keep-alive proves + * + * keepalive_intvl + * number of seconds between TCP keep-alive probes + * + * keepalive_probes + * max number of probers to send before giving up + * and killing tcp connection + */ +extern int setsockopt_tcp_keepalive(int sock, uint16_t keepalive_idle, + uint16_t keepalive_intvl, + uint16_t keepalive_probes); + #ifdef __cplusplus } #endif |
