FileDocCategorySizeDatePackage
SocketProperties.javaAPI DocApache Tomcat 6.0.149464Fri Jul 20 04:20:34 BST 2007org.apache.tomcat.util.net

SocketProperties

public class SocketProperties extends Object
Properties that can be set in the <Connector> element in server.xml. All properties are prefixed with "socket." and are currently only working for the Nio connector
author
Filip Hanik

Fields Summary
protected int
keyCache
Enable/disable key cache, this bounded cache stores KeyAttachment objects to reduce GC Default is 500 -1 is unlimited 0 is disabled
protected int
processorCache
Enable/disable socket processor cache, this bounded cache stores SocketProcessor objects to reduce GC Default is 500 -1 is unlimited 0 is disabled
protected int
eventCache
Enable/disable poller event cache, this bounded cache stores PollerEvent objects to reduce GC for the poller Default is 500 -1 is unlimited 0 is disabled >0 the max number of objects to keep in cache.
protected boolean
directBuffer
Enable/disable direct buffers for the network buffers Default value is enabled
protected int
rxBufSize
Socket receive buffer size in bytes (SO_RCVBUF) Default value is 25188
protected int
txBufSize
Socket send buffer size in bytes (SO_SNDBUF) Default value is 43800
protected int
appReadBufSize
The application read buffer size in bytes. Default value is rxBufSize
protected int
appWriteBufSize
The application write buffer size in bytes Default value is txBufSize
protected int
bufferPool
NioChannel pool size for the endpoint, this value is how many channels -1 means unlimited cached, 0 means no cache Default value is 500
protected int
bufferPoolSize
Buffer pool size in bytes to be cached -1 means unlimited, 0 means no cache Default value is 100MB (1024*1024*100 bytes)
protected boolean
tcpNoDelay
TCP_NO_DELAY option, default is true
protected boolean
soKeepAlive
SO_KEEPALIVE option, default is false
protected boolean
ooBInline
OOBINLINE option, default is true
protected boolean
soReuseAddress
SO_REUSEADDR option, default is true
protected boolean
soLingerOn
SO_LINGER option, default is true, paired with the soLingerTime value
protected int
soLingerTime
SO_LINGER option, default is 25 seconds.
protected int
soTimeout
SO_TIMEOUT option, default is 5000 milliseconds
protected int
soTrafficClass
Traffic class option, value between 0 and 255 IPTOS_LOWCOST (0x02) IPTOS_RELIABILITY (0x04) IPTOS_THROUGHPUT (0x08) IPTOS_LOWDELAY (0x10) Default value is 0x04 | 0x08 | 0x010
protected int
performanceConnectionTime
Performance preferences according to http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) Default value is 1
protected int
performanceLatency
Performance preferences according to http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) Default value is 0
protected int
performanceBandwidth
Performance preferences according to http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) Default value is 1
private Socket
properties
Constructors Summary
Methods Summary
public intgetAppReadBufSize()

        return appReadBufSize;
    
public intgetAppWriteBufSize()

        return appWriteBufSize;
    
public intgetBufferPool()

        return bufferPool;
    
public intgetBufferPoolSize()

        return bufferPoolSize;
    
public booleangetDirectBuffer()

        return directBuffer;
    
public intgetDirectBufferPool()

        return bufferPool;
    
public intgetEventCache()

        return eventCache;
    
public intgetKeyCache()

        return keyCache;
    
public booleangetOoBInline()

        return ooBInline;
    
public intgetPerformanceBandwidth()

        return performanceBandwidth;
    
public intgetPerformanceConnectionTime()

        return performanceConnectionTime;
    
public intgetPerformanceLatency()

        return performanceLatency;
    
public intgetProcessorCache()

        return processorCache;
    
public java.net.SocketgetProperties()

        return properties;
    
public intgetRxBufSize()

        return rxBufSize;
    
public booleangetSoKeepAlive()

        return soKeepAlive;
    
public booleangetSoLingerOn()

        return soLingerOn;
    
public intgetSoLingerTime()

        return soLingerTime;
    
public booleangetSoReuseAddress()

        return soReuseAddress;
    
public intgetSoTimeout()

        return soTimeout;
    
public intgetSoTrafficClass()

        return soTrafficClass;
    
public booleangetTcpNoDelay()

        return tcpNoDelay;
    
public intgetTxBufSize()

        return txBufSize;
    
public voidsetAppReadBufSize(int appReadBufSize)

        this.appReadBufSize = appReadBufSize;
    
public voidsetAppWriteBufSize(int appWriteBufSize)

        this.appWriteBufSize = appWriteBufSize;
    
public voidsetBufferPool(int bufferPool)

        this.bufferPool = bufferPool;
    
public voidsetBufferPoolSize(int bufferPoolSize)

        this.bufferPoolSize = bufferPoolSize;
    
public voidsetDirectBuffer(boolean directBuffer)

        this.directBuffer = directBuffer;
    
public voidsetDirectBufferPool(int directBufferPool)

        this.bufferPool = directBufferPool;
    
public voidsetEventCache(int eventCache)

        this.eventCache = eventCache;
    
public voidsetKeyCache(int keyCache)

        this.keyCache = keyCache;
    
public voidsetOoBInline(boolean ooBInline)

        this.ooBInline = ooBInline;
    
public voidsetPerformanceBandwidth(int performanceBandwidth)

        this.performanceBandwidth = performanceBandwidth;
    
public voidsetPerformanceConnectionTime(int performanceConnectionTime)

        this.performanceConnectionTime = performanceConnectionTime;
    
public voidsetPerformanceLatency(int performanceLatency)

        this.performanceLatency = performanceLatency;
    
public voidsetProcessorCache(int processorCache)

        this.processorCache = processorCache;
    
public voidsetProperties(java.net.Socket socket)


         
        socket.setReceiveBufferSize(rxBufSize);
        socket.setSendBufferSize(txBufSize);
        socket.setOOBInline(ooBInline);
        socket.setKeepAlive(soKeepAlive);
        socket.setPerformancePreferences(performanceConnectionTime,performanceLatency,performanceBandwidth);
        socket.setReuseAddress(soReuseAddress);
        socket.setSoLinger(soLingerOn,soLingerTime);
        socket.setSoTimeout(soTimeout);
        socket.setTcpNoDelay(tcpNoDelay);
        socket.setTrafficClass(soTrafficClass);
    
public voidsetRxBufSize(int rxBufSize)

        this.rxBufSize = rxBufSize;
    
public voidsetSoKeepAlive(boolean soKeepAlive)

        this.soKeepAlive = soKeepAlive;
    
public voidsetSoLingerOn(boolean soLingerOn)

        this.soLingerOn = soLingerOn;
    
public voidsetSoLingerTime(int soLingerTime)

        this.soLingerTime = soLingerTime;
    
public voidsetSoReuseAddress(boolean soReuseAddress)

        this.soReuseAddress = soReuseAddress;
    
public voidsetSoTimeout(int soTimeout)

        this.soTimeout = soTimeout;
    
public voidsetSoTrafficClass(int soTrafficClass)

        this.soTrafficClass = soTrafficClass;
    
public voidsetTcpNoDelay(boolean tcpNoDelay)

        this.tcpNoDelay = tcpNoDelay;
    
public voidsetTxBufSize(int txBufSize)

        this.txBufSize = txBufSize;