summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/TCPConnector.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-11-20 17:16:11 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-11-20 17:16:11 +0000
commit5aac7f448a513687dca2be93996c1d645fb668f7 (patch)
treeadead91b692175c2141e1af0d521378908dc89b3 /cpp/src/qpid/client/TCPConnector.cpp
parentfc4472ab30f5fc6df5722341b30abd69bd2040bb (diff)
downloadqpid-python-5aac7f448a513687dca2be93996c1d645fb668f7.tar.gz
QPID-4447: C++ Client can hang during connect if heartbeat disconnect fires
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1411750 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/TCPConnector.cpp')
-rw-r--r--cpp/src/qpid/client/TCPConnector.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/TCPConnector.cpp b/cpp/src/qpid/client/TCPConnector.cpp
index b92f342b74..783742764b 100644
--- a/cpp/src/qpid/client/TCPConnector.cpp
+++ b/cpp/src/qpid/client/TCPConnector.cpp
@@ -151,6 +151,11 @@ void TCPConnector::socketClosed(AsynchIO&, const Socket&) {
shutdownHandler->shutdown();
}
+void TCPConnector::connectAborted() {
+ connector->stop();
+ connectFailed("Connection timedout");
+}
+
void TCPConnector::abort() {
// Can't abort a closed connection
if (!closed) {
@@ -159,8 +164,7 @@ void TCPConnector::abort() {
aio->requestCallback(boost::bind(&TCPConnector::eof, this, _1));
} else if (connector) {
// We're still connecting
- connector->stop();
- connectFailed("Connection timedout");
+ connector->requestCallback(boost::bind(&TCPConnector::connectAborted, this));
}
}
}