提交 c9050a5e 编写于 作者: 陶建辉(Jeff)'s avatar 陶建辉(Jeff)

change the socket option

上级 5ee38748
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册