summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-06-28 20:54:28 +0000
committerChris Wilson <chris+github@qwirx.com>2007-06-28 20:54:28 +0000
commit7c581bcb685e99e37b64752b1e85330765e3be0f (patch)
tree3576a7e38f9aa07afc89ebe8be7bea388249d083 /lib
parent592d1e26597202ce0eed301d61981823cd7084f9 (diff)
Log reasons for failure to connect to a socket.
Diffstat (limited to 'lib')
-rw-r--r--lib/server/SocketStream.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/server/SocketStream.cpp b/lib/server/SocketStream.cpp
index 61d3846f..ebc57041 100644
--- a/lib/server/SocketStream.cpp
+++ b/lib/server/SocketStream.cpp
@@ -15,6 +15,7 @@
#include <sys/types.h>
#include <errno.h>
+#include <string.h>
#ifndef WIN32
#include <poll.h>
@@ -164,6 +165,10 @@ void SocketStream::Open(int Type, const char *Name, int Port)
#else
::close(mSocketHandle);
#endif
+ BOX_ERROR("Failed to connect to socket (type " << Type <<
+ ", name " << Name << ", port " << Port << "): " <<
+ "error " << errno << " (" << strerror(errno) <<
+ ")");
mSocketHandle = INVALID_SOCKET_VALUE;
THROW_EXCEPTION(ConnectionException, Conn_SocketConnectError)
}