Package com.kristensoft.kdc
Class TcpClientSocketOptions
- java.lang.Object
-
- com.kristensoft.kdc.TcpClientSocketOptions
-
public final class TcpClientSocketOptions extends Object
Defines socket options used to configure a TCP client socket.Socket options are applied when the TCP client creates its socket. Except where KDC provides an explicit default, an option value of
nullleaves the corresponding socket setting unchanged.By default, TCP keep-alive is enabled and
SO_LINGERis enabled with a linger time of zero seconds. All other socket options are left unchanged unless explicitly configured.Instances are created using the
TcpClientSocketOptions.Builder.- Author:
- Charles B. Kozoyed
- See Also:
TcpClientSocketOptions.Builder,SocketConfigurator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTcpClientSocketOptions.BuilderBuildsTcpClientSocketOptionsinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleangetKeepAlive()Returns whether TCP keep-alive is enabled.BooleangetOobInline()Returns whether received TCP urgent data is placed inline with normal socket data.IntegergetReceiveBufferSize()Returns the configured socket receive buffer size.BooleangetReuseAddress()Returns whether the socket address may be reused.IntegergetSendBufferSize()Returns the configured socket send buffer size.BooleangetSoLingerOn()Returns whetherSO_LINGERis enabled.IntegergetSoLingerTime()Returns the configuredSO_LINGERtime.IntegergetSoTimeout()Returns the configured socket read timeout.BooleangetTcpNoDelay()Returns whether the Nagle algorithm is disabled for the socket.IntegergetTrafficClass()Returns the configured IP traffic class.
-
-
-
Method Detail
-
getKeepAlive
public Boolean getKeepAlive()
Returns whether TCP keep-alive is enabled.- Returns:
trueif TCP keep-alive is enabled,falseif disabled, ornullif the socket setting should remain unchanged
-
getReuseAddress
public Boolean getReuseAddress()
Returns whether the socket address may be reused.- Returns:
trueif address reuse is enabled,falseif disabled, ornullif the socket setting should remain unchanged
-
getReceiveBufferSize
public Integer getReceiveBufferSize()
Returns the configured socket receive buffer size.- Returns:
- the receive buffer size in bytes, or
nullif the socket setting should remain unchanged
-
getSendBufferSize
public Integer getSendBufferSize()
Returns the configured socket send buffer size.- Returns:
- the send buffer size in bytes, or
nullif the socket setting should remain unchanged
-
getSoTimeout
public Integer getSoTimeout()
Returns the configured socket read timeout.- Returns:
- the socket read timeout in milliseconds, or
nullif the socket setting should remain unchanged
-
getSoLingerOn
public Boolean getSoLingerOn()
Returns whetherSO_LINGERis enabled.- Returns:
trueifSO_LINGERis enabled,falseif disabled, ornullif the socket setting should remain unchanged
-
getSoLingerTime
public Integer getSoLingerTime()
Returns the configuredSO_LINGERtime.- Returns:
- the linger time in seconds, or
nullif the socket setting should remain unchanged
-
getTcpNoDelay
public Boolean getTcpNoDelay()
Returns whether the Nagle algorithm is disabled for the socket.- Returns:
trueif the Nagle algorithm is disabled,falseif enabled, ornullif the socket setting should remain unchanged
-
getTrafficClass
public Integer getTrafficClass()
Returns the configured IP traffic class.- Returns:
- the IP traffic class value, or
nullif the socket setting should remain unchanged
-
getOobInline
public Boolean getOobInline()
Returns whether received TCP urgent data is placed inline with normal socket data.- Returns:
trueif urgent data is received inline,falseotherwise, ornullif the socket setting should remain unchanged
-
-