mirror of https://github.com/apache/activemq.git
make size of io buffers configurable
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@470390 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fdcc973923
commit
166a04bc58
|
@ -55,7 +55,8 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
||||||
|
|
||||||
protected int connectionTimeout = 30000;
|
protected int connectionTimeout = 30000;
|
||||||
protected int soTimeout = 0;
|
protected int soTimeout = 0;
|
||||||
protected int socketBufferSize = 128 * 1024;
|
protected int socketBufferSize = 64 * 1024;
|
||||||
|
protected int ioBufferSize = 8 * 1024;
|
||||||
protected Socket socket;
|
protected Socket socket;
|
||||||
protected DataOutputStream dataOut;
|
protected DataOutputStream dataOut;
|
||||||
protected DataInputStream dataIn;
|
protected DataInputStream dataIn;
|
||||||
|
@ -242,6 +243,20 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
||||||
this.tcpNoDelay = 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
|
// Implementation methods
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
@ -350,9 +365,9 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeStreams() throws Exception {
|
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);
|
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);
|
this.dataOut = new DataOutputStream(buffOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,4 +390,8 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue