Add more logging for TCP.

This commit is contained in:
Andrea Odetti 2022-03-26 18:07:16 +00:00
parent 1c427f1072
commit 5c3819af77

View file

@ -660,7 +660,10 @@ void Uthernet2::receiveOnePacketFromSocket(const size_t i)
}
else if (data == 0)
{
// gracefull termination
#ifdef U2_LOG_TRAFFIC
LogFileOutput("U2: %s[%" SIZE_T_FMT "]: recvfrom result = %" PTRDIFF_T_FMT "\n", proto, i, data);
#endif
// graceful termination
socket.clearFD();
}
else // data < 0;
@ -669,7 +672,7 @@ void Uthernet2::receiveOnePacketFromSocket(const size_t i)
if (error != SOCK_EAGAIN && error != SOCK_EWOULDBLOCK)
{
#ifdef U2_LOG_TRAFFIC
LogFileOutput("U2: %s[%" SIZE_T_FMT "]: recvfrom error %" ERROR_FMT "\n", proto, i, STRERROR(error));
LogFileOutput("U2: %s[%" SIZE_T_FMT "]: recvfrom result = %" PTRDIFF_T_FMT ", error = %" ERROR_FMT "\n", proto, i, data, STRERROR(error));
#endif
socket.clearFD();
}