activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r383894 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp: CommandChannel.java DatagramHeaderMarshaller.java
Date Tue, 07 Mar 2006 14:12:17 GMT
Author: jstrachan
Date: Tue Mar  7 06:12:11 2006
New Revision: 383894

URL: http://svn.apache.org/viewcvs?rev=383894&view=rev
Log:
add the data size to datagram headers

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java?rev=383894&r1=383893&r2=383894&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
Tue Mar  7 06:12:11 2006
@@ -111,6 +111,7 @@
         int size = wireFormat.tightMarshalNestedObject1(command, bs);
         if (size < datagramSize ) {
             header.setPartial(false);
+            header.setDataSize(size);
             writeBuffer.rewind();
             wireFormat.marshal(command, dataOut);
             dataOut.flush();
@@ -132,6 +133,7 @@
                 writeBuffer.rewind();
                 int chunkSize = writeBuffer.capacity() - headerMarshaller.getHeaderSize(header);
                 lastFragment = offset + chunkSize >= length;
+                header.setDataSize(chunkSize);
                 header.setComplete(lastFragment);
                 headerMarshaller.writeHeader(header, writeBuffer);
 

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java?rev=383894&r1=383893&r2=383894&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
Tue Mar  7 06:12:11 2006
@@ -28,6 +28,7 @@
     public DatagramHeader readHeader(ByteBuffer readBuffer) {
         DatagramHeader answer = new DatagramHeader();
         answer.setCounter(readBuffer.getLong());
+        answer.setDataSize(readBuffer.getInt());
         byte flags = readBuffer.get();
         answer.setFlags(flags);
         return answer;
@@ -35,11 +36,12 @@
 
     public void writeHeader(DatagramHeader header, ByteBuffer writeBuffer) {
         writeBuffer.putLong(header.getCounter());
+        writeBuffer.putInt(header.getDataSize());
         writeBuffer.put(header.getFlags());
     }
 
     public int getHeaderSize(DatagramHeader header) {
-        return 8 + 1;
+        return 8 + 4 + 1;
     }
 
 }



Mime
View raw message