public class SocketOptions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE_BYTE
default buffer size of Bytes
|
static int |
KILO_BYTE
constant for kilobyte
|
Constructor and Description |
---|
SocketOptions() |
SocketOptions(SocketOptions socketOptions) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getBufferSize()
Gets the SO_SNDBUF and SO_RCVBUF option value
|
int |
getLingerSeconds()
Gets SO_LINGER with the specified linger time in seconds
|
int |
hashCode() |
boolean |
isKeepAlive()
SO_KEEPALIVE socket option
|
boolean |
isReuseAddress()
SO_REUSEADDR socket option.
|
boolean |
isTcpNoDelay()
TCP_NODELAY socket option
|
SocketOptions |
setBufferSize(int bufferSize)
Sets the SO_SNDBUF and SO_RCVBUF options to the specified value in KB
|
SocketOptions |
setKeepAlive(boolean keepAlive)
Enable/disable SO_KEEPALIVE socket option.
|
SocketOptions |
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.
|
SocketOptions |
setReuseAddress(boolean reuseAddress)
Enable/disable the SO_REUSEADDR socket option.
|
SocketOptions |
setTcpNoDelay(boolean tcpNoDelay)
Enable/disable TCP_NODELAY socket option.
|
public static final int KILO_BYTE
public static final int DEFAULT_BUFFER_SIZE_BYTE
public SocketOptions()
public SocketOptions(SocketOptions socketOptions)
public boolean isTcpNoDelay()
public SocketOptions setTcpNoDelay(boolean tcpNoDelay)
tcpNoDelay
- public boolean isKeepAlive()
public SocketOptions setKeepAlive(boolean keepAlive)
keepAlive
- enabled if truepublic boolean isReuseAddress()
public SocketOptions setReuseAddress(boolean reuseAddress)
reuseAddress
- enabled if truepublic int getLingerSeconds()
public SocketOptions setLingerSeconds(int lingerSeconds)
DEFAULT_LINGER_SECONDS
lingerSeconds
- value in secondspublic int getBufferSize()
public SocketOptions setBufferSize(int bufferSize)
bufferSize
- KB valueCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.