activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r470390 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Date Thu, 02 Nov 2006 15:35:47 GMT
Author: rajdavies
Date: Thu Nov  2 07:35:46 2006
New Revision: 470390

URL: http://svn.apache.org/viewvc?view=rev&rev=470390
Log:
make size of io buffers configurable

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?view=diff&rev=470390&r1=470389&r2=470390
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Thu Nov  2 07:35:46 2006
@@ -55,7 +55,8 @@
 
     protected int connectionTimeout = 30000;
     protected int soTimeout = 0;
-    protected int socketBufferSize = 128 * 1024;
+    protected int socketBufferSize = 64 * 1024;
+    protected int ioBufferSize = 8 * 1024;
     protected Socket socket;
     protected DataOutputStream dataOut;
     protected DataInputStream dataIn;
@@ -241,6 +242,20 @@
     public void setTcpNoDelay(Boolean tcpNoDelay) {
         this.tcpNoDelay = tcpNoDelay;
     }
+    
+    /**
+     * @return the ioBufferSize
+     */
+    public int getIoBufferSize(){
+        return this.ioBufferSize;
+    }
+
+    /**
+     * @param ioBufferSize the ioBufferSize to set
+     */
+    public void setIoBufferSize(int ioBufferSize){
+        this.ioBufferSize=ioBufferSize;
+    }
 
 
     // Implementation methods
@@ -350,9 +365,9 @@
     }
 
     protected void initializeStreams() throws Exception {
-        TcpBufferedInputStream buffIn = new TcpBufferedInputStream(socket.getInputStream(),
8 * 1024);
+        TcpBufferedInputStream buffIn = new TcpBufferedInputStream(socket.getInputStream(),
ioBufferSize);
         this.dataIn = new DataInputStream(buffIn);
-        TcpBufferedOutputStream buffOut = new TcpBufferedOutputStream(socket.getOutputStream(),
16 * 1024);
+        TcpBufferedOutputStream buffOut = new TcpBufferedOutputStream(socket.getOutputStream(),
ioBufferSize);
         this.dataOut = new DataOutputStream(buffOut);
     }
 
@@ -375,4 +390,8 @@
         }
         return null;
     }
+
+
+    
+  
 }



Mime
View raw message