[Box Backup-commit] COMMIT r1742 - box/chris/general/lib/server

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Thu, 26 Jul 2007 22:36:12 +0100


Author: chris
Date: 2007-07-26 22:36:12 +0100 (Thu, 26 Jul 2007)
New Revision: 1742

Modified:
   box/chris/general/lib/server/SocketStream.cpp
Log:
Log reasons for failure to connect to a socket. (refs #3, merges [1708])


Modified: box/chris/general/lib/server/SocketStream.cpp
===================================================================
--- box/chris/general/lib/server/SocketStream.cpp	2007-07-26 21:35:52 UTC (rev 1741)
+++ box/chris/general/lib/server/SocketStream.cpp	2007-07-26 21:36:12 UTC (rev 1742)
@@ -15,6 +15,7 @@
 
 #include <sys/types.h>
 #include <errno.h>
+#include <string.h>
 
 #ifndef WIN32
 #include <poll.h>
@@ -164,6 +165,10 @@
 #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)
 	}