Package com.hazelcast.client.config
Class SocketOptions
java.lang.Object
com.hazelcast.client.config.SocketOptions
TCP Socket options
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
default buffer size of Bytesstatic final int
constant for kilobyte -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Gets the SO_SNDBUF and SO_RCVBUF option valueint
Gets SO_LINGER with the specified linger time in secondsint
hashCode()
boolean
SO_KEEPALIVE socket optionboolean
SO_REUSEADDR socket option.boolean
TCP_NODELAY socket optionsetBufferSize
(int bufferSize) Sets the SO_SNDBUF and SO_RCVBUF options to the specified value in KBsetKeepAlive
(boolean keepAlive) Enable/disable SO_KEEPALIVE socket option.setLingerSeconds
(int lingerSeconds) Enable/disable SO_LINGER with the specified linger time in seconds If set to a value of 0 or less then it is disabled.setReuseAddress
(boolean reuseAddress) Enable/disable the SO_REUSEADDR socket option.setTcpNoDelay
(boolean tcpNoDelay) Enable/disable TCP_NODELAY socket option.toString()
-
Field Details
-
KILO_BYTE
public static final int KILO_BYTEconstant for kilobyte- See Also:
-
DEFAULT_BUFFER_SIZE_BYTE
public static final int DEFAULT_BUFFER_SIZE_BYTEdefault buffer size of Bytes- See Also:
-
-
Constructor Details
-
SocketOptions
public SocketOptions() -
SocketOptions
-
-
Method Details
-
isTcpNoDelay
public boolean isTcpNoDelay()TCP_NODELAY socket option- Returns:
- true if enabled
-
setTcpNoDelay
Enable/disable TCP_NODELAY socket option.- Parameters:
tcpNoDelay
- the TCP_NODELAY socket option- Returns:
- SocketOptions configured
-
isKeepAlive
public boolean isKeepAlive()SO_KEEPALIVE socket option- Returns:
- true if enabled
-
setKeepAlive
Enable/disable SO_KEEPALIVE socket option.- Parameters:
keepAlive
- enabled if true- Returns:
- SocketOptions configured
-
isReuseAddress
public boolean isReuseAddress()SO_REUSEADDR socket option.- Returns:
- true if enabled
-
setReuseAddress
Enable/disable the SO_REUSEADDR socket option.- Parameters:
reuseAddress
- enabled if true- Returns:
- SocketOptions configured
-
getLingerSeconds
public int getLingerSeconds()Gets SO_LINGER with the specified linger time in seconds- Returns:
- lingerSeconds value in seconds
-
setLingerSeconds
Enable/disable SO_LINGER with the specified linger time in seconds If set to a value of 0 or less then it is disabled. Default value isDEFAULT_LINGER_SECONDS
- Parameters:
lingerSeconds
- value in seconds- Returns:
- SocketOptions configured
-
getBufferSize
public int getBufferSize()Gets the SO_SNDBUF and SO_RCVBUF option value- Returns:
- bufferSize KB value
-
setBufferSize
Sets the SO_SNDBUF and SO_RCVBUF options to the specified value in KB- Parameters:
bufferSize
- KB value- Returns:
- SocketOptions configured
-
equals
-
hashCode
public int hashCode() -
toString
-