Print listening socket error code as well on bind failure
This commit is contained in:
@@ -41,7 +41,7 @@ ListeningSocket::ListeningSocket(int const port)
|
|||||||
sizeof(sockaddr_in));
|
sizeof(sockaddr_in));
|
||||||
if (bindResult < 0)
|
if (bindResult < 0)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("socket bind error");
|
throw std::runtime_error("socket bind error code " + std::to_string(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
int const listenResult = listen(socketFileDescriptor, connectionLimit);
|
int const listenResult = listen(socketFileDescriptor, connectionLimit);
|
||||||
|
|||||||
Reference in New Issue
Block a user