From c9050a5e173696581c251f06f79afa9a5c503bb6 Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Wed, 29 Jul 2020 01:46:14 +0000 Subject: [PATCH] change the socket option --- src/util/src/tsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c index 6c536a4303..f95cae25e9 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -306,7 +306,7 @@ int taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clientI sockFd = -1; } - // taosKeepTcpAlive(sockFd); + taosKeepTcpAlive(sockFd); return sockFd; } @@ -349,7 +349,7 @@ int taosKeepTcpAlive(int sockFd) { struct linger linger = {0}; linger.l_onoff = 1; - //linger.l_linger = 0; + linger.l_linger = 3; if (taosSetSockOpt(sockFd, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger)) < 0) { uError("setsockopt SO_LINGER failed: %d (%s)", errno, strerror(errno)); close(sockFd); -- GitLab