diff options
author | Gordon Sim <gsim@apache.org> | 2010-04-16 18:16:30 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2010-04-16 18:16:30 +0000 |
commit | 3485fe658a38634178747791cf1575c0ec80e9f6 (patch) | |
tree | 589bc5a01ad059801c07a7d0ebfd99396a6cd9e6 /cpp/src | |
parent | 01c4e84bd5eb1e2647e8c8a531e5180c62cc1c15 (diff) | |
download | qpid-python-3485fe658a38634178747791cf1575c0ec80e9f6.tar.gz |
Ensure that ConnectionImpl is notified of shutdown even in the case of disconnect (which needs different handling than eof)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@935017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/TCPConnector.cpp | 7 | ||||
-rw-r--r-- | cpp/src/qpid/client/TCPConnector.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/TCPConnector.cpp b/cpp/src/qpid/client/TCPConnector.cpp index 3ead7e2ce0..d0a12c8522 100644 --- a/cpp/src/qpid/client/TCPConnector.cpp +++ b/cpp/src/qpid/client/TCPConnector.cpp @@ -104,7 +104,7 @@ void TCPConnector::connected(const Socket&) { aio = AsynchIO::create(socket, boost::bind(&TCPConnector::readbuff, this, _1, _2), boost::bind(&TCPConnector::eof, this, _1), - boost::bind(&TCPConnector::eof, this, _1), + boost::bind(&TCPConnector::disconnected, this, _1), boost::bind(&TCPConnector::socketClosed, this, _1, _2), 0, // nobuffs boost::bind(&TCPConnector::writebuff, this, _1)); @@ -313,6 +313,11 @@ void TCPConnector::eof(AsynchIO&) { close(); } +void TCPConnector::disconnected(AsynchIO&) { + close(); + socketClosed(*aio, socket); +} + void TCPConnector::activateSecurityLayer(std::auto_ptr<qpid::sys::SecurityLayer> sl) { securityLayer = sl; diff --git a/cpp/src/qpid/client/TCPConnector.h b/cpp/src/qpid/client/TCPConnector.h index 04504a5173..bce5f593c6 100644 --- a/cpp/src/qpid/client/TCPConnector.h +++ b/cpp/src/qpid/client/TCPConnector.h @@ -104,6 +104,7 @@ protected: bool readbuff(qpid::sys::AsynchIO&, qpid::sys::AsynchIOBufferBase*); void writebuff(qpid::sys::AsynchIO&); void eof(qpid::sys::AsynchIO&); + void disconnected(qpid::sys::AsynchIO&); void socketClosed(qpid::sys::AsynchIO&, const qpid::sys::Socket&); public: |