Add optional log rotation and fix a UDP bug.

This commit is contained in:
Jonathan Naylor
2020-11-01 12:54:51 +00:00
parent 9e4587c1d3
commit 83a929c2b4
18 changed files with 134 additions and 16 deletions
+6
View File
@@ -289,6 +289,12 @@ int CUDPSocket::read(unsigned char* buffer, unsigned int length, sockaddr_storag
LogError("Error returned from recvfrom, err: %lu", ::GetLastError());
#else
LogError("Error returned from recvfrom, err: %d", errno);
if (len == -1 && errno == ENOTSOCK) {
LogMessage("Re-opening UDP port on %u", m_port);
close();
open();
}
#endif
return -1;
}