summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
index beb647afe6..d4c64dd814 100644
--- a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
+++ b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
@@ -144,12 +144,10 @@ class AsynchConnector : public qpid::sys::AsynchConnector,
private:
void connComplete(DispatchHandle& handle);
- void syncFailure();
private:
ConnectedCallback connCallback;
FailedCallback failCallback;
- std::string errMsg;
const Socket& socket;
public:
@@ -176,21 +174,13 @@ AsynchConnector::AsynchConnector(const Socket& s,
{
socket.setNonblocking();
SocketAddress sa(hostname, boost::lexical_cast<std::string>(port));
- try {
- socket.connect(sa);
- } catch(std::exception& e) {
- // Defer reporting failure till we start polling
- errMsg = e.what();
- }
+ // Note, not catching any exceptions here, also has effect of destructing
+ socket.connect(sa);
}
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::syncFailure, this));
- }
}
void AsynchConnector::connComplete(DispatchHandle& h)
@@ -205,13 +195,6 @@ void AsynchConnector::connComplete(DispatchHandle& h)
DispatchHandle::doDelete();
}
-void AsynchConnector::syncFailure()
-{
- DispatchHandle::stopWatch();
- failCallback(socket, -1, errMsg);
- DispatchHandle::doDelete();
-}
-
/*
* POSIX version of AsynchIO reader/writer
*