From a78c6232f96124ca0a62ff6e5e6aa02b82f0f4b4 Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Wed, 29 Jul 2020 05:24:34 +0000 Subject: [PATCH] set 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 f95cae25e9..6f4d2b8afd 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -304,10 +304,10 @@ int taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clientI //uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno)); close(sockFd); sockFd = -1; + } else { + taosKeepTcpAlive(sockFd); } - taosKeepTcpAlive(sockFd); - return sockFd; } -- GitLab