fix(rpc): fix invalide fqdn

This commit is contained in:
yihaoDeng 2022-05-07 18:17:55 +08:00
parent fe62139a7f
commit cb115f1c10
2 changed files with 6 additions and 1 deletions

View File

@ -850,7 +850,7 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
}
}
if (false == taosValidIpAndPort(srv->ip, srv->port)) {
tError("failed to bind, reason: %s", terrstr());
tError("failed to bind, reason: %s", strerror(TAOS_SYSTEM_ERROR(errno)));
goto End;
}
if (false == addHandleToAcceptloop(srv)) {

View File

@ -677,6 +677,11 @@ bool taosValidIpAndPort(uint32_t ip, uint16_t port) {
taosCloseSocket(&pSocket);
return false;
}
if (listen(pSocket->fd, 1024) < 0) {
// printf("listen tcp server socket failed, 0x%x:%hu(%s)", ip, port, strerror(errno));
taosCloseSocket(&pSocket);
return NULL;
}
taosCloseSocket(&pSocket);
return true;
}