You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2010/01/21 07:20:13 UTC
svn commit: r901555 - /qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
Author: astitcher
Date: Thu Jan 21 06:20:07 2010
New Revision: 901555
URL: http://svn.apache.org/viewvc?rev=901555&view=rev
Log:
Throw sync connect failures straight out of AsynchConnector constructor
Modified:
qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp?rev=901555&r1=901554&r2=901555&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp Thu Jan 21 06:20:07 2010
@@ -144,12 +144,10 @@
private:
void connComplete(DispatchHandle& handle);
- void syncFailure();
private:
ConnectedCallback connCallback;
FailedCallback failCallback;
- std::string errMsg;
const Socket& socket;
public:
@@ -176,21 +174,13 @@
{
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 @@
DispatchHandle::doDelete();
}
-void AsynchConnector::syncFailure()
-{
- DispatchHandle::stopWatch();
- failCallback(socket, -1, errMsg);
- DispatchHandle::doDelete();
-}
-
/*
* POSIX version of AsynchIO reader/writer
*
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org