Skip to content

Commit

Permalink
FEAT(server): Add error code when UDP socket binding fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowknight26 committed May 7, 2024
1 parent 1eecd5b commit 762a143
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/murmur/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ Server::Server(int snum, QObject *p) : QThread(p) {
}

if (::bind(sock, reinterpret_cast< sockaddr * >(&addr), len) == SOCKET_ERROR) {
log(QString("Failed to bind UDP Socket to %1").arg(addressToString(ss->serverAddress(), usPort)));
#ifdef Q_OS_WIN
log(QString("Failed to bind UDP Socket to %1: %2").arg(addressToString(ss->serverAddress(), usPort), WSAGetLastError()));
#else
log(QString("Failed to bind UDP Socket to %1: %2").arg(addressToString(ss->serverAddress(), usPort), errno));
#endif
} else {
#ifdef Q_OS_UNIX
int val = 0xe0;
Expand Down

0 comments on commit 762a143

Please sign in to comment.