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 | 3be692caf7d6a6dde102c9f2c25f2d332d8bf069 (patch) | |
| tree | 7e73e24e56dceeb13dc3687d7c3efec2b889e13f /qpid/cpp/src | |
| parent | 68ff613bfed3818aae03b9bc6f214484557468d0 (diff) | |
| download | qpid-python-3be692caf7d6a6dde102c9f2c25f2d332d8bf069.tar.gz | |
Make TCP more like RDMA
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@903503 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/client/TCPConnector.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/client/TCPConnector.cpp b/qpid/cpp/src/qpid/client/TCPConnector.cpp index 94c4a4cae0..78c9b32069 100644 --- a/qpid/cpp/src/qpid/client/TCPConnector.cpp +++ b/qpid/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(); } |
