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/27 00:56:42 UTC

svn commit: r903503 - /qpid/trunk/qpid/cpp/src/qpid/client/TCPConnector.cpp

Author: astitcher
Date: Tue Jan 26 23:56:40 2010
New Revision: 903503

URL: http://svn.apache.org/viewvc?rev=903503&view=rev
Log:
Make TCP more like RDMA

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/TCPConnector.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/TCPConnector.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/TCPConnector.cpp?rev=903503&r1=903502&r2=903503&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/TCPConnector.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/TCPConnector.cpp Tue Jan 26 23:56:40 2010
@@ -139,8 +139,8 @@
 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 @@
 }
 
 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();
 }
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org