From: Anthony Minessale Date: Fri, 15 Aug 2014 19:43:20 +0000 (+0500) Subject: FS-6738 #comment can you test this patch and see if the tcp keepalive can detect... X-Git-Tag: v1.4.8~5^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ee48c22101e5713e2d14ecb175f5d938a003fd9;p=thirdparty%2Ffreeswitch.git FS-6738 #comment can you test this patch and see if the tcp keepalive can detect the timeout --- diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 73219240b6..98d1f8de59 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -3235,6 +3235,18 @@ static int start_jsock(verto_profile_t *profile, int sock) /* no nagle please */ setsockopt(jsock->client_socket, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)); + +#if defined(SO_KEEPALIVE) + setsockopt(jsock->client_socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&flag, sizeof(flag)); +#endif + flag = 30; +#if defined(TCP_KEEPIDLE) + setsockopt(jsock->client_socket, SOL_TCP, TCP_KEEPIDLE, (void *)&flag, sizeof(flag)); +#endif +#if defined(TCP_KEEPINTVL) + setsockopt(jsock->client_socket, SOL_TCP, TCP_KEEPINTVL, (void *)&flag, sizeof(flag)); +#endif + td = switch_core_alloc(jsock->pool, sizeof(*td)); td->alloc = 0;