[examples][tcpserver]打印错误值errno

This commit is contained in:
yangpeng 2023-12-26 19:24:55 +08:00 committed by Rbb666
parent fb8f1458d0
commit e92d66eeac
1 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ static void tcpserv(void *arg)
bytes_received = recv(connected, recv_data, BUFSZ, 0);
if (bytes_received < 0)
{
LOG_E("Received error, close the connect.");
LOG_E("Received error(%d), close the connect.", errno);
closesocket(connected);
connected = -1;
break;
@ -180,7 +180,7 @@ static void tcpserv(void *arg)
ret = send(connected, send_data, rt_strlen(send_data), 0);
if (ret < 0)
{
LOG_E("send error, close the connect.");
LOG_E("send error(%d), close the connect.", errno);
closesocket(connected);
connected = -1;
break;