diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-11-20 17:16:11 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-11-20 17:16:11 +0000 |
| commit | 5aac7f448a513687dca2be93996c1d645fb668f7 (patch) | |
| tree | adead91b692175c2141e1af0d521378908dc89b3 /cpp/src/qpid/client/TCPConnector.cpp | |
| parent | fc4472ab30f5fc6df5722341b30abd69bd2040bb (diff) | |
| download | qpid-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.cpp | 8 |
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)); } } } |
