Print listening socket error code as well on bind failure

This commit is contained in:
2019-06-19 20:03:47 +02:00
parent 4592c77148
commit cbc45ca76a

View File

@@ -41,7 +41,7 @@ ListeningSocket::ListeningSocket(int const port)
sizeof(sockaddr_in));
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);