## org.apache.tomcat.util.net
Class SocketProperties

    java.lang.Object
      org.apache.tomcat.util.net.SocketProperties

    public class SocketProperties

extends java.lang.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

Field Summary
`protected int` `appReadBufSize` The application read buffer size in bytes.
`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` `directBuffer` Enable/disable direct buffers for the network buffers Default value is enabled
`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 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 boolean` `ooBInline` OOBINLINE option, default is true
`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
`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` `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` `rxBufSize` Socket receive buffer size in bytes (SO_RCVBUF) Default value is 25188
`protected boolean` `soKeepAlive` SO_KEEPALIVE option, default is false
`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 boolean` `soReuseAddress` SO_REUSEADDR option, default is true
`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 boolean` `tcpNoDelay` TCP_NO_DELAY option, default is true
`protected long` `timeoutInterval` The minimum frequency of the timeout interval to avoid the poller going boinkers during high traffic
`protected int` `txBufSize` Socket send buffer size in bytes (SO_SNDBUF) Default value is 43800

Constructor Summary
`SocketProperties()`

Method Summary
`int` `getAppReadBufSize()`
`int` `getAppWriteBufSize()`
`int` `getBufferPool()`
`int` `getBufferPoolSize()`
`boolean` `getDirectBuffer()`
`int` `getDirectBufferPool()`
`int` `getEventCache()`
`int` `getKeyCache()`
`boolean` `getOoBInline()`
`int` `getPerformanceBandwidth()`
`int` `getPerformanceConnectionTime()`
`int` `getPerformanceLatency()`
`int` `getProcessorCache()`
`java.net.Socket` `getProperties()`
`int` `getRxBufSize()`
`boolean` `getSoKeepAlive()`
`boolean` `getSoLingerOn()`
`int` `getSoLingerTime()`
`boolean` `getSoReuseAddress()`
`int` `getSoTimeout()`
`int` `getSoTrafficClass()`
`boolean` `getTcpNoDelay()`
`long` `getTimeoutInterval()`
`int` `getTxBufSize()`
`void` `setAppReadBufSize(int appReadBufSize)`
`void` `setAppWriteBufSize(int appWriteBufSize)`
`void` `setBufferPool(int bufferPool)`
`void` `setBufferPoolSize(int bufferPoolSize)`
`void` `setDirectBuffer(boolean directBuffer)`
`void` `setDirectBufferPool(int directBufferPool)`
`void` `setEventCache(int eventCache)`
`void` `setKeyCache(int keyCache)`
`void` `setOoBInline(boolean ooBInline)`
`void` `setPerformanceBandwidth(int performanceBandwidth)`
`void` `setPerformanceConnectionTime(int performanceConnectionTime)`
`void` `setPerformanceLatency(int performanceLatency)`
`void` `setProcessorCache(int processorCache)`
`void` `setProperties(java.net.Socket socket)`
`void` `setRxBufSize(int rxBufSize)`
`void` `setSoKeepAlive(boolean soKeepAlive)`
`void` `setSoLingerOn(boolean soLingerOn)`
`void` `setSoLingerTime(int soLingerTime)`
`void` `setSoReuseAddress(boolean soReuseAddress)`
`void` `setSoTimeout(int soTimeout)`
`void` `setSoTrafficClass(int soTrafficClass)`
`void` `setTcpNoDelay(boolean tcpNoDelay)`
`void` `setTimeoutInterval(long timeoutInterval)`
`void` `setTxBufSize(int txBufSize)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### keyCache

    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

### processorCache

    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

### eventCache

    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.

### directBuffer

    protected boolean directBuffer

  Enable/disable direct buffers for the network buffers Default value is enabled

### rxBufSize

    protected int rxBufSize

  Socket receive buffer size in bytes (SO_RCVBUF) Default value is 25188

### txBufSize

    protected int txBufSize

  Socket send buffer size in bytes (SO_SNDBUF) Default value is 43800

### appReadBufSize

    protected int appReadBufSize

  The application read buffer size in bytes. Default value is rxBufSize

### appWriteBufSize

    protected int appWriteBufSize

  The application write buffer size in bytes Default value is txBufSize

### bufferPool

    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

### bufferPoolSize

    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)

### tcpNoDelay

    protected boolean tcpNoDelay

  TCP_NO_DELAY option, default is true

### soKeepAlive

    protected boolean soKeepAlive

  SO_KEEPALIVE option, default is false

### ooBInline

    protected boolean ooBInline

  OOBINLINE option, default is true

### soReuseAddress

    protected boolean soReuseAddress

  SO_REUSEADDR option, default is true

### soLingerOn

    protected boolean soLingerOn

  SO_LINGER option, default is true, paired with the `soLingerTime` value

### soLingerTime

    protected int soLingerTime

  SO_LINGER option, default is 25 seconds.

### soTimeout

    protected int soTimeout

  SO_TIMEOUT option, default is 5000 milliseconds

### soTrafficClass

    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

### performanceConnectionTime

    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

### performanceLatency

    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

### performanceBandwidth

    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

### timeoutInterval

    protected long timeoutInterval

  The minimum frequency of the timeout interval to avoid the poller going boinkers during high traffic

Constructor Detail

### SocketProperties

    public SocketProperties()

Method Detail

### setProperties

    public void setProperties(java.net.Socket socket)
                       throws java.net.SocketException

  Throws:
    `java.net.SocketException`

### getDirectBuffer

    public boolean getDirectBuffer()

### getOoBInline

    public boolean getOoBInline()

### getPerformanceBandwidth

    public int getPerformanceBandwidth()

### getPerformanceConnectionTime

    public int getPerformanceConnectionTime()

### getPerformanceLatency

    public int getPerformanceLatency()

### getRxBufSize

    public int getRxBufSize()

### getSoKeepAlive

    public boolean getSoKeepAlive()

### getSoLingerOn

    public boolean getSoLingerOn()

### getSoLingerTime

    public int getSoLingerTime()

### getSoReuseAddress

    public boolean getSoReuseAddress()

### getSoTimeout

    public int getSoTimeout()

### getSoTrafficClass

    public int getSoTrafficClass()

### getTcpNoDelay

    public boolean getTcpNoDelay()

### getTxBufSize

    public int getTxBufSize()

### getBufferPool

    public int getBufferPool()

### getBufferPoolSize

    public int getBufferPoolSize()

### getEventCache

    public int getEventCache()

### getKeyCache

    public int getKeyCache()

### getProperties

    public java.net.Socket getProperties()

### getAppReadBufSize

    public int getAppReadBufSize()

### getAppWriteBufSize

    public int getAppWriteBufSize()

### getProcessorCache

    public int getProcessorCache()

### getTimeoutInterval

    public long getTimeoutInterval()

### getDirectBufferPool

    public int getDirectBufferPool()

### setPerformanceConnectionTime

    public void setPerformanceConnectionTime(int performanceConnectionTime)

### setTxBufSize

    public void setTxBufSize(int txBufSize)

### setTcpNoDelay

    public void setTcpNoDelay(boolean tcpNoDelay)

### setSoTrafficClass

    public void setSoTrafficClass(int soTrafficClass)

### setSoTimeout

    public void setSoTimeout(int soTimeout)

### setSoReuseAddress

    public void setSoReuseAddress(boolean soReuseAddress)

### setSoLingerTime

    public void setSoLingerTime(int soLingerTime)

### setSoKeepAlive

    public void setSoKeepAlive(boolean soKeepAlive)

### setRxBufSize

    public void setRxBufSize(int rxBufSize)

### setPerformanceLatency

    public void setPerformanceLatency(int performanceLatency)

### setPerformanceBandwidth

    public void setPerformanceBandwidth(int performanceBandwidth)

### setOoBInline

    public void setOoBInline(boolean ooBInline)

### setDirectBuffer

    public void setDirectBuffer(boolean directBuffer)

### setSoLingerOn

    public void setSoLingerOn(boolean soLingerOn)

### setBufferPool

    public void setBufferPool(int bufferPool)

### setBufferPoolSize

    public void setBufferPoolSize(int bufferPoolSize)

### setEventCache

    public void setEventCache(int eventCache)

### setKeyCache

    public void setKeyCache(int keyCache)

### setAppReadBufSize

    public void setAppReadBufSize(int appReadBufSize)

### setAppWriteBufSize

    public void setAppWriteBufSize(int appWriteBufSize)

### setProcessorCache

    public void setProcessorCache(int processorCache)

### setTimeoutInterval

    public void setTimeoutInterval(long timeoutInterval)

### setDirectBufferPool

    public void setDirectBufferPool(int directBufferPool)

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.