summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-01-21 06:15:40 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-01-21 06:15:40 +0000
commit66266d1f34066c5960ae1eb4f28b8c7758cb46c9 (patch)
tree1a7b6e56c6d6581e276499c2574e80dfa587ff2e /cpp/src
parent4dae7bc7c71ead4a97c192f839abb1b3c64a55a9 (diff)
downloadqpid-python-66266d1f34066c5960ae1eb4f28b8c7758cb46c9.tar.gz
Small refactor of AsynchConnector to have a more regular structure
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@901548 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/sys/posix/AsynchIO.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/cpp/src/qpid/sys/posix/AsynchIO.cpp b/cpp/src/qpid/sys/posix/AsynchIO.cpp
index 5ffe9b2b11..beb647afe6 100644
--- a/cpp/src/qpid/sys/posix/AsynchIO.cpp
+++ b/cpp/src/qpid/sys/posix/AsynchIO.cpp
@@ -144,7 +144,7 @@ class AsynchConnector : public qpid::sys::AsynchConnector,
private:
void connComplete(DispatchHandle& handle);
- void failure(int, const std::string&);
+ void syncFailure();
private:
ConnectedCallback connCallback;
@@ -189,27 +189,26 @@ void AsynchConnector::start(Poller::shared_ptr poller)
startWatch(poller);
// If we previously detected an error insert failure callback now
if ( !errMsg.empty() ) {
- DispatchHandle::call(boost::bind(&AsynchConnector::failure, this, -1, errMsg));
+ DispatchHandle::call(boost::bind(&AsynchConnector::syncFailure, this));
}
}
void AsynchConnector::connComplete(DispatchHandle& h)
{
- int errCode = socket.getError();
-
h.stopWatch();
+ int errCode = socket.getError();
if (errCode == 0) {
connCallback(socket);
- DispatchHandle::doDelete();
} else {
- failure(errCode, strError(errCode));
+ failCallback(socket, errCode, strError(errCode));
}
+ DispatchHandle::doDelete();
}
-void AsynchConnector::failure(int errCode, const std::string& message)
+void AsynchConnector::syncFailure()
{
- failCallback(socket, errCode, message);
-
+ DispatchHandle::stopWatch();
+ failCallback(socket, -1, errMsg);
DispatchHandle::doDelete();
}