提交 0ee48c22 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-6738 #comment can you test this patch and see if the tcp keepalive can detect the timeout

上级 24413bfa
...@@ -3235,6 +3235,18 @@ static int start_jsock(verto_profile_t *profile, int sock) ...@@ -3235,6 +3235,18 @@ static int start_jsock(verto_profile_t *profile, int sock)
/* no nagle please */ /* no nagle please */
setsockopt(jsock->client_socket, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)); 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 = switch_core_alloc(jsock->pool, sizeof(*td));
td->alloc = 0; td->alloc = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论