未验证 提交 f5e6e845 编写于 作者: H huili 提交者: GitHub

Merge pull request #4996 from taosdata/hotfix/test

[TD-2792]<fix> for windows usage, remote shutdown also returns - 1 in…
...@@ -140,6 +140,7 @@ void taosStopUdpConnection(void *handle) { ...@@ -140,6 +140,7 @@ void taosStopUdpConnection(void *handle) {
pConn = pSet->udpConn + i; pConn = pSet->udpConn + i;
if (pConn->fd >=0) shutdown(pConn->fd, SHUT_RDWR); if (pConn->fd >=0) shutdown(pConn->fd, SHUT_RDWR);
if (pConn->fd >=0) taosCloseSocket(pConn->fd); if (pConn->fd >=0) taosCloseSocket(pConn->fd);
pConn->fd = -1;
} }
for (int i = 0; i < pSet->threads; ++i) { for (int i = 0; i < pSet->threads; ++i) {
...@@ -198,8 +199,13 @@ static void *taosRecvUdpData(void *param) { ...@@ -198,8 +199,13 @@ static void *taosRecvUdpData(void *param) {
while (1) { while (1) {
dataLen = recvfrom(pConn->fd, pConn->buffer, RPC_MAX_UDP_SIZE, 0, (struct sockaddr *)&sourceAdd, &addLen); dataLen = recvfrom(pConn->fd, pConn->buffer, RPC_MAX_UDP_SIZE, 0, (struct sockaddr *)&sourceAdd, &addLen);
if(dataLen <= 0) { if(dataLen <= 0) {
tDebug("%s UDP socket was closed, exiting(%s)", pConn->label, strerror(errno)); tDebug("%s UDP socket(fd:%d) receive dataLen(%d) error(%s)", pConn->label, pConn->fd, (int32_t)dataLen, strerror(errno));
break; // for windows usage, remote shutdown also returns - 1 in windows client
if (-1 == pConn->fd) {
break;
} else {
continue;
}
} }
port = ntohs(sourceAdd.sin_port); port = ntohs(sourceAdd.sin_port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册