Modifier and Type | Method and Description |
---|---|
int |
getInputBufferSize()
Gets the input buffer size.
|
int |
getOutputBufferSize()
Gets the output buffer size.
|
boolean |
isKeepAlive()
Is TCP keep alive set?
|
boolean |
isNoDelay()
Is TCP no delay option set?
|
boolean |
isReuseAddress()
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.
|
void setInputBufferSize(int size) throws ConfigException
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.
size
- input buffer size in bytesConfigException
- if unable to set propertyint getInputBufferSize()
void setOutputBufferSize(int size) throws ConfigException
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.
size
- output buffer size in bytesConfigException
- if unable to set propertyint getOutputBufferSize()
void setKeepAlive(boolean keepAlive) throws ConfigException
By default this is true.
keepAlive
- true to set TCP keep alive.ConfigException
- if unable to set propertyboolean isKeepAlive()
void setNoDelay(boolean noDelay) throws ConfigException
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm). By default this is true.
noDelay
- true to set no delay optionConfigException
- if unable to set propertyboolean isNoDelay()
void setReuseAddress(boolean reuseAddress) throws ConfigException
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.
reuseAddress
- true to set reuse address optionConfigException
- if unable to set propertyboolean isReuseAddress()
Copyright © 2021 Push Technology Ltd. All Rights Reserved.