From 921e6946c9b2dd885e50a7ce6c6466c25f6a69af Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 28 Nov 2011 22:04:45 +0000 Subject: [PATCH] fix identification of failed TCP connection --- panda/src/net/connectionManager.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panda/src/net/connectionManager.cxx b/panda/src/net/connectionManager.cxx index e045e43d7e..cf144271fc 100644 --- a/panda/src/net/connectionManager.cxx +++ b/panda/src/net/connectionManager.cxx @@ -234,6 +234,14 @@ open_TCP_client_connection(const NetAddress &address, int timeout_ms) { } } + if (okflag) { + // So, the connect() operation finished, but did it succeed or fail? + if (socket->GetPeerName().GetIPAddressRaw() == 0) { + // No peer means it failed. + okflag = false; + } + } + if (!okflag) { net_cat.error() << "Unable to open TCP connection to server "