[TD-2792]<fix> for windows usage, remote shutdown also returns - 1 in windows client
This commit is contained in:
parent
bbd045f53e
commit
41f00a4924
|
@ -140,6 +140,7 @@ void taosStopUdpConnection(void *handle) {
|
|||
pConn = pSet->udpConn + i;
|
||||
if (pConn->fd >=0) shutdown(pConn->fd, SHUT_RDWR);
|
||||
if (pConn->fd >=0) taosCloseSocket(pConn->fd);
|
||||
pConn->fd = -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < pSet->threads; ++i) {
|
||||
|
@ -198,8 +199,13 @@ static void *taosRecvUdpData(void *param) {
|
|||
while (1) {
|
||||
dataLen = recvfrom(pConn->fd, pConn->buffer, RPC_MAX_UDP_SIZE, 0, (struct sockaddr *)&sourceAdd, &addLen);
|
||||
if(dataLen <= 0) {
|
||||
tDebug("%s UDP socket was closed, exiting(%s)", pConn->label, strerror(errno));
|
||||
break;
|
||||
tDebug("%s UDP socket(fd:%d) receive dataLen(%d) error(%s)", pConn->label, pConn->fd, (int32_t)dataLen, strerror(errno));
|
||||
// for windows usage, remote shutdown also returns - 1 in windows client
|
||||
if (-1 == pConn->fd) {
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
port = ntohs(sourceAdd.sin_port);
|
||||
|
|
Loading…
Reference in New Issue