Skip to content

Commit

Permalink
Comment out Windows Socket error printing code for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulay committed Jun 14, 2023
1 parent 844da12 commit 1edfeb9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Central/UDPsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,20 @@ cbRESULT UDPSocket::OpenTCP(STARTUP_OPTIONS nStartupOptionsFlags, int nRange, bo

void UDPSocket::Close()
{
int err = 0;
#ifdef WIN32
char errbuf[300];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(),
0, errbuf, sizeof(errbuf), NULL);
err = ::WSAGetLastError();
// TODO: Get string representation of error.
// char errbuf[300]; // TODO: Needs to be LPWSTR
// FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, errbuf, sizeof(errbuf), NULL);
// fprintf(stderr, "UDPSocket error: %s\n", errbuf);
#else
int sv_err = errno;
const char* errbuf = strerror(sv_err);
err = errno;
const char* errbuf = strerror(err);
fprintf(stderr, "UDPSocket error: %s\n", errbuf);
#endif
fprintf(stderr, "UDP socket error: %s\n", errbuf);
TRACE("UDPSocket error number was %i\n", err);

m_TCPconnected = false;
shutdown(inst_sock, SD_BOTH); // shutdown communication
#ifdef WIN32
Expand Down

0 comments on commit 1edfeb9

Please sign in to comment.