Top Description Fields Constructors Methods
org.apache.tomcat.util.net

public Class SocketProperties

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.ServerSocket, .Socket, .SocketException, .StandardSocketOptions, java.nio.channels.AsynchronousServerSocketChannel, .AsynchronousSocketChannel, javax.management.ObjectName

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

Field Summary

Modifier and TypeField and Description
protected int
appReadBufSize

The application read buffer size in bytes.

protected int
appWriteBufSize

The application write buffer size in bytes Default value is 8192

protected int
bufferPool

NioChannel pool size for the endpoint, this value is how many channels -1 means unlimited cached, 0 means no cache, -2 means bufferPoolSize will be used Default value is -2

protected int
bufferPoolSize

Buffer pool size in bytes to be cached -1 means unlimited, 0 means no cache Default value is based on the max memory reported by the JVM, if less than 1GB, then 0, else the value divided by 32.

protected boolean
directBuffer

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

protected boolean
directSslBuffer

Enable/disable direct buffers for the network buffers for SSL Default value is disabled

protected int
eventCache

Enable/disable poller event cache, this bounded cache stores PollerEvent objects to reduce GC for the poller Default is 0 -1 is unlimited 0 is disabled >0 the max number of objects to keep in cache.

private ObjectName
protected Boolean
ooBInline

OOBINLINE option.

protected Integer
performanceBandwidth

Performance preferences according to http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) All three performance attributes must be set or the JVM defaults will be used.

protected Integer
performanceConnectionTime

Performance preferences according to http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) All three performance attributes must be set or the JVM defaults will be used.

protected Integer
performanceLatency

Performance preferences according to http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) All three performance attributes must be set or the JVM defaults will be used.

protected int
processorCache

Enable/disable socket processor cache, this bounded cache stores SocketProcessor objects to reduce GC Default is 0 -1 is unlimited 0 is disabled

protected Integer
rxBufSize

Socket receive buffer size in bytes (SO_RCVBUF).

protected Boolean
soKeepAlive

SO_KEEPALIVE option.

protected Boolean
soLingerOn

SO_LINGER option, paired with the soLingerTime value.

protected Integer
soLingerTime

SO_LINGER option, paired with the soLingerOn value.

protected Boolean
soReuseAddress

SO_REUSEADDR option.

protected Integer
soTimeout

SO_TIMEOUT option.

protected Boolean
tcpNoDelay

TCP_NO_DELAY option.

protected long
timeoutInterval

The minimum frequency of the timeout interval to avoid excess load from the poller during high traffic

protected Integer
txBufSize

Socket send buffer size in bytes (SO_SNDBUF).

protected int
unlockTimeout

Timeout in milliseconds for an unlock to take place.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the actual buffer pool size that will be used
getActualBufferPool
(int
When TLS is enabled, additional network buffers are needed and will be added to the application buffer size
bufferOverhead
)

Get the actual buffer pool size to use.

public int
public int
public int
public int
public boolean
public int
public boolean
public int
pack-priv ObjectName
public boolean
public int
public int
public int
public int
public int
public boolean
public boolean
public int
public boolean
public int
public boolean
public long
public int
public int
public void
setAppReadBufSize(int appReadBufSize)

public void
setAppWriteBufSize(int appWriteBufSize)

public void
setBufferPool(int bufferPool)

public void
setBufferPoolSize(int bufferPoolSize)

public void
setDirectBuffer(boolean directBuffer)

public void
setDirectBufferPool(int directBufferPool)

public void
setDirectSslBuffer(boolean directSslBuffer)

public void
setEventCache(int eventCache)

pack-priv void
public void
setOoBInline(boolean ooBInline)

public void
setPerformanceBandwidth(int performanceBandwidth)

public void
setPerformanceConnectionTime(int performanceConnectionTime)

public void
setPerformanceLatency(int performanceLatency)

public void
setProcessorCache(int processorCache)

public void
public void
public void
public void
public void
setRxBufSize(int rxBufSize)

public void
setSoKeepAlive(boolean soKeepAlive)

public void
setSoLingerOn(boolean soLingerOn)

public void
setSoLingerTime(int soLingerTime)

public void
setSoReuseAddress(boolean soReuseAddress)

public void
setSoTimeout(int soTimeout)

public void
setTcpNoDelay(boolean tcpNoDelay)

public void
setTimeoutInterval(long timeoutInterval)

public void
setTxBufSize(int txBufSize)

public void
setUnlockTimeout(int unlockTimeout)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appReadBufSizeback to summary
protected int appReadBufSize

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

appWriteBufSizeback to summary
protected int appWriteBufSize

The application write buffer size in bytes Default value is 8192

bufferPoolback to summary
protected int bufferPool

NioChannel pool size for the endpoint, this value is how many channels -1 means unlimited cached, 0 means no cache, -2 means bufferPoolSize will be used Default value is -2

bufferPoolSizeback to summary
protected int bufferPoolSize

Buffer pool size in bytes to be cached -1 means unlimited, 0 means no cache Default value is based on the max memory reported by the JVM, if less than 1GB, then 0, else the value divided by 32. This value will then be used to compute bufferPool if its value is -2

directBufferback to summary
protected boolean directBuffer

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

directSslBufferback to summary
protected boolean directSslBuffer

Enable/disable direct buffers for the network buffers for SSL Default value is disabled

eventCacheback to summary
protected int eventCache

Enable/disable poller event cache, this bounded cache stores PollerEvent objects to reduce GC for the poller Default is 0 -1 is unlimited 0 is disabled >0 the max number of objects to keep in cache.

onameback to summary
private ObjectName oname
ooBInlineback to summary
protected Boolean ooBInline

OOBINLINE option. JVM default used if not set.

performanceBandwidthback to summary
protected Integer performanceBandwidth

Performance preferences according to http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) All three performance attributes must be set or the JVM defaults will be used.

performanceConnectionTimeback to summary
protected Integer performanceConnectionTime

Performance preferences according to http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) All three performance attributes must be set or the JVM defaults will be used.

performanceLatencyback to summary
protected Integer performanceLatency

Performance preferences according to http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) All three performance attributes must be set or the JVM defaults will be used.

processorCacheback to summary
protected int processorCache

Enable/disable socket processor cache, this bounded cache stores SocketProcessor objects to reduce GC Default is 0 -1 is unlimited 0 is disabled

rxBufSizeback to summary
protected Integer rxBufSize

Socket receive buffer size in bytes (SO_RCVBUF). JVM default used if not set.

soKeepAliveback to summary
protected Boolean soKeepAlive

SO_KEEPALIVE option. JVM default used if not set.

soLingerOnback to summary
protected Boolean soLingerOn

SO_LINGER option, paired with the soLingerTime value. JVM defaults used unless both attributes are set.

soLingerTimeback to summary
protected Integer soLingerTime

SO_LINGER option, paired with the soLingerOn value. JVM defaults used unless both attributes are set.

soReuseAddressback to summary
protected Boolean soReuseAddress

SO_REUSEADDR option. JVM default used if not set.

soTimeoutback to summary
protected Integer soTimeout

SO_TIMEOUT option. default is 20000.

tcpNoDelayback to summary
protected Boolean tcpNoDelay

TCP_NO_DELAY option. JVM default used if not set.

timeoutIntervalback to summary
protected long timeoutInterval

The minimum frequency of the timeout interval to avoid excess load from the poller during high traffic

txBufSizeback to summary
protected Integer txBufSize

Socket send buffer size in bytes (SO_SNDBUF). JVM default used if not set.

unlockTimeoutback to summary
protected int unlockTimeout

Timeout in milliseconds for an unlock to take place.

Constructor Detail

SocketPropertiesback to summary
public SocketProperties()

Method Detail

getActualBufferPoolback to summary
public int getActualBufferPool(int bufferOverhead)

Get the actual buffer pool size to use.

Parameters
bufferOverhead:int

When TLS is enabled, additional network buffers are needed and will be added to the application buffer size

Returns:int

the actual buffer pool size that will be used

getAppReadBufSizeback to summary
public int getAppReadBufSize()
getAppWriteBufSizeback to summary
public int getAppWriteBufSize()
getBufferPoolback to summary
public int getBufferPool()
getBufferPoolSizeback to summary
public int getBufferPoolSize()
getDirectBufferback to summary
public boolean getDirectBuffer()
getDirectBufferPoolback to summary
public int getDirectBufferPool()
getDirectSslBufferback to summary
public boolean getDirectSslBuffer()
getEventCacheback to summary
public int getEventCache()
getObjectNameback to summary
pack-priv ObjectName getObjectName()
getOoBInlineback to summary
public boolean getOoBInline()
getPerformanceBandwidthback to summary
public int getPerformanceBandwidth()
getPerformanceConnectionTimeback to summary
public int getPerformanceConnectionTime()
getPerformanceLatencyback to summary
public int getPerformanceLatency()
getProcessorCacheback to summary
public int getProcessorCache()
getRxBufSizeback to summary
public int getRxBufSize()
getSoKeepAliveback to summary
public boolean getSoKeepAlive()
getSoLingerOnback to summary
public boolean getSoLingerOn()
getSoLingerTimeback to summary
public int getSoLingerTime()
getSoReuseAddressback to summary
public boolean getSoReuseAddress()
getSoTimeoutback to summary
public int getSoTimeout()
getTcpNoDelayback to summary
public boolean getTcpNoDelay()
getTimeoutIntervalback to summary
public long getTimeoutInterval()
getTxBufSizeback to summary
public int getTxBufSize()
getUnlockTimeoutback to summary
public int getUnlockTimeout()
setAppReadBufSizeback to summary
public void setAppReadBufSize(int appReadBufSize)
setAppWriteBufSizeback to summary
public void setAppWriteBufSize(int appWriteBufSize)
setBufferPoolback to summary
public void setBufferPool(int bufferPool)
setBufferPoolSizeback to summary
public void setBufferPoolSize(int bufferPoolSize)
setDirectBufferback to summary
public void setDirectBuffer(boolean directBuffer)
setDirectBufferPoolback to summary
public void setDirectBufferPool(int directBufferPool)
setDirectSslBufferback to summary
public void setDirectSslBuffer(boolean directSslBuffer)
setEventCacheback to summary
public void setEventCache(int eventCache)
setObjectNameback to summary
pack-priv void setObjectName(ObjectName oname)
setOoBInlineback to summary
public void setOoBInline(boolean ooBInline)
setPerformanceBandwidthback to summary
public void setPerformanceBandwidth(int performanceBandwidth)
setPerformanceConnectionTimeback to summary
public void setPerformanceConnectionTime(int performanceConnectionTime)
setPerformanceLatencyback to summary
public void setPerformanceLatency(int performanceLatency)
setProcessorCacheback to summary
public void setProcessorCache(int processorCache)
setPropertiesback to summary
public void setProperties(Socket socket) throws SocketException
setPropertiesback to summary
public void setProperties(ServerSocket socket) throws SocketException
setPropertiesback to summary
public void setProperties(AsynchronousSocketChannel socket) throws IOException
setPropertiesback to summary
public void setProperties(AsynchronousServerSocketChannel socket) throws IOException
setRxBufSizeback to summary
public void setRxBufSize(int rxBufSize)
setSoKeepAliveback to summary
public void setSoKeepAlive(boolean soKeepAlive)
setSoLingerOnback to summary
public void setSoLingerOn(boolean soLingerOn)
setSoLingerTimeback to summary
public void setSoLingerTime(int soLingerTime)
setSoReuseAddressback to summary
public void setSoReuseAddress(boolean soReuseAddress)
setSoTimeoutback to summary
public void setSoTimeout(int soTimeout)
setTcpNoDelayback to summary
public void setTcpNoDelay(boolean tcpNoDelay)
setTimeoutIntervalback to summary
public void setTimeoutInterval(long timeoutInterval)
setTxBufSizeback to summary
public void setTxBufSize(int txBufSize)
setUnlockTimeoutback to summary
public void setUnlockTimeout(int unlockTimeout)