diff options
author | Andrew Stitcher <astitcher@apache.org> | 2010-01-26 23:56:40 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2010-01-26 23:56:40 +0000 |
commit | 292067c024adf53c704fe3b7d3e336c76fc18ff3 (patch) | |
tree | 838ca4bba51adf7b5e95274bd61215b63225f789 | |
parent | ebb1c7b36f8b2756b686bf162e45c45d0d56f3ee (diff) | |
download | qpid-python-292067c024adf53c704fe3b7d3e336c76fc18ff3.tar.gz |
Make TCP more like RDMA
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@903503 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/client/TCPConnector.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/qpid/client/TCPConnector.cpp b/cpp/src/qpid/client/TCPConnector.cpp index 94c4a4cae0..78c9b32069 100644 --- a/cpp/src/qpid/client/TCPConnector.cpp +++ b/cpp/src/qpid/client/TCPConnector.cpp @@ -139,8 +139,8 @@ void TCPConnector::connectFailed(const std::string& msg) { bool TCPConnector::closeInternal() { Mutex::ScopedLock l(lock); bool ret = !closed; - if (!closed) { - closed = true; + closed = true; + if (ret) { if (aio) aio->queueForDeletion(); socket.close(); @@ -186,18 +186,20 @@ const std::string& TCPConnector::getIdentifier() const { } void TCPConnector::send(AMQFrame& frame) { + bool notifyWrite = false; + { Mutex::ScopedLock l(lock); frames.push_back(frame); //only ask to write if this is the end of a frameset or if we //already have a buffers worth of data currentSize += frame.encodedSize(); - bool notifyWrite = false; if (frame.getEof()) { lastEof = frames.size(); notifyWrite = true; } else { notifyWrite = (currentSize >= maxFrameSize); } + } if (notifyWrite && !closed) aio->notifyPendingWrite(); } |