From 90ed79ef1ea673df63e85adf9c355226f8bbc1df Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 8 Sep 2010 16:49:50 +0000 Subject: Delay client side Rdma connection disconnect() so that it happens serialised to the data channel for the connection. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@995144 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/RdmaConnector.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/client/RdmaConnector.cpp b/cpp/src/qpid/client/RdmaConnector.cpp index e5be1f8fbf..f8f38fb050 100644 --- a/cpp/src/qpid/client/RdmaConnector.cpp +++ b/cpp/src/qpid/client/RdmaConnector.cpp @@ -82,7 +82,8 @@ class RdmaConnector : public Connector, public sys::Codec // Callbacks void connected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&); void connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, Rdma::ErrorType); - void disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr); + void disconnectAction(); + void disconnected(); void rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams&); void readbuff(Rdma::AsynchIO&, Rdma::Buffer*); @@ -176,7 +177,7 @@ void RdmaConnector::connect(const std::string& host, int port){ Rdma::ConnectionParams(maxFrameSize, Rdma::DEFAULT_WR_ENTRIES), boost::bind(&RdmaConnector::connected, this, poller, _1, _2), boost::bind(&RdmaConnector::connectionError, this, poller, _1, _2), - boost::bind(&RdmaConnector::disconnected, this, poller, _1), + boost::bind(&RdmaConnector::disconnected, this), boost::bind(&RdmaConnector::rejected, this, poller, _1, _2))); polling = true; @@ -228,7 +229,7 @@ void RdmaConnector::connectionError(sys::Poller::shared_ptr, Rdma::Connection::i stopped(); } -void RdmaConnector::disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr) { +void RdmaConnector::disconnectAction() { QPID_LOG(debug, "Connection disconnected " << identifier); { Mutex::ScopedLock l(pollingLock); @@ -239,6 +240,10 @@ void RdmaConnector::disconnected(sys::Poller::shared_ptr, Rdma::Connection::intr drained(); } +void RdmaConnector::disconnected() { + aio->requestCallback(boost::bind(&RdmaConnector::disconnectAction, this)); +} + void RdmaConnector::rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr, const Rdma::ConnectionParams& cp) { QPID_LOG(debug, "Connection Rejected " << identifier << ": " << cp.maxRecvBufferSize); { -- cgit v1.2.1