Interface SocketConditioningConfig
- All Superinterfaces:
Config
This allows TCP connection details for a connector to be defined.
Values can only be set before the server is started unless otherwise stated.
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the input buffer size.int
Gets the output buffer size.boolean
Is TCP keep alive set?boolean
Is TCP no delay option set?boolean
Is reuse address option set?void
setInputBufferSize
(int size) Sets the input buffer size.void
setKeepAlive
(boolean keepAlive) Sets the TCP keep alive option.void
setNoDelay
(boolean noDelay) Sets the no delay option.void
setOutputBufferSize
(int size) Sets the output buffer size.void
setReuseAddress
(boolean reuseAddress) Sets the reuse address option.
-
Method Details
-
setInputBufferSize
Sets the input buffer size.This value specified the size to use for the socket input buffer, this must be be big enough to accommodate the largest inbound message.
If not specified, 128kB is assumed.
- Parameters:
size
- input buffer size in bytes- Throws:
ConfigException
- if unable to set property
-
getInputBufferSize
int getInputBufferSize()Gets the input buffer size.- Returns:
- input buffer size in bytes.
-
setOutputBufferSize
Sets the output buffer size.This value specifies the size of the output buffer to use for each connection. This must be large enough to accommodate the largest message to be sent. Messages are 'batched' into this buffer and so the larger the buffer, the more messages can be sent in a single write.
If this is not specified, 128kB is assumed.
- Parameters:
size
- output buffer size in bytes- Throws:
ConfigException
- if unable to set property
-
getOutputBufferSize
int getOutputBufferSize()Gets the output buffer size.- Returns:
- output buffer size.
-
setKeepAlive
Sets the TCP keep alive option.By default this is true.
- Parameters:
keepAlive
- true to set TCP keep alive.- Throws:
ConfigException
- if unable to set property
-
isKeepAlive
boolean isKeepAlive()Is TCP keep alive set?- Returns:
- true if TCP keep alive is set.
-
setNoDelay
Sets the no delay option.Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm). By default this is true.
- Parameters:
noDelay
- true to set no delay option- Throws:
ConfigException
- if unable to set property
-
isNoDelay
boolean isNoDelay()Is TCP no delay option set?- Returns:
- true if no delay option is set.
-
setReuseAddress
Sets the reuse address option.When a TCP connection is closed the connection may remain in a timeout state for a period of time after the connection is closed (typically known as the TIME_WAIT state or 2MSL wait state). For applications using a well known socket address or port it may not be possible to bind a socket to the required SocketAddress if there is a connection in the timeout state involving the socket address or port. This feature allows the socket to be bound even though a previous connection is in a timeout state.
By default this is set to true.
- Parameters:
reuseAddress
- true to set reuse address option- Throws:
ConfigException
- if unable to set property
-
isReuseAddress
boolean isReuseAddress()Is reuse address option set?- Returns:
- true if reuse address option is set
-