allow the TCP_NODELAY option to be configured

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@436745 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-08-25 10:11:33 +00:00
parent a420312a40
commit d21381d21b
1 changed files with 15 additions and 0 deletions

View File

@ -65,6 +65,7 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
protected boolean useLocalHost = true;
protected int minmumWireFormatVersion;
private Boolean keepAlive;
private Boolean tcpNoDelay;
/**
* Connect to a remote Node - e.g. a Broker
@ -219,6 +220,17 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
this.keepAlive = keepAlive;
}
public Boolean getTcpNoDelay() {
return tcpNoDelay;
}
/**
* Enable/disable the TCP_NODELAY option on the socket
*/
public void setTcpNoDelay(Boolean tcpNoDelay) {
this.tcpNoDelay = tcpNoDelay;
}
// Implementation methods
// -------------------------------------------------------------------------
@ -252,6 +264,9 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
if (keepAlive != null) {
sock.setKeepAlive(keepAlive.booleanValue());
}
if (tcpNoDelay != null) {
sock.setTcpNoDelay(tcpNoDelay.booleanValue());
}
}
protected void doStart() throws Exception {