qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r600501 - /incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/OutputHandler.java
Date Mon, 03 Dec 2007 12:14:49 GMT
Author: arnaudsimon
Date: Mon Dec  3 04:14:48 2007
New Revision: 600501

URL: http://svn.apache.org/viewvc?rev=600501&view=rev
Log:
merged the three writes in a single one

Modified:
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/OutputHandler.java

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/OutputHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/OutputHandler.java?rev=600501&r1=600500&r2=600501&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/OutputHandler.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/OutputHandler.java
Mon Dec  3 04:14:48 2007
@@ -69,7 +69,7 @@
 
     public void frame(Frame frame)
     {
-        ByteBuffer hdr = ByteBuffer.allocate(HEADER_SIZE);
+       ByteBuffer hdr = ByteBuffer.allocate(HEADER_SIZE +   frame.getSize() + 1);
         hdr.put(frame.getFlags());
         hdr.put(frame.getType());
         hdr.putShort((short) (frame.getSize() + HEADER_SIZE));
@@ -80,19 +80,15 @@
         hdr.put(RESERVED);
         hdr.put(RESERVED);
         hdr.put(RESERVED);
+        for(ByteBuffer buf : frame)
+        {
+            hdr.put(buf);
+        }
+        hdr.put((byte) Constant.FRAME_END);
         hdr.flip();
-
         synchronized (lock)
         {
             sender.send(hdr);
-            for (ByteBuffer buf : frame)
-            {
-                sender.send(buf);
-            }
-            ByteBuffer end = ByteBuffer.allocate(1);
-            end.put((byte) Constant.FRAME_END);
-            end.flip();
-            sender.send(end);
         }
     }
 



Mime
View raw message