Package com.kristensoft.kdc
Class SocketOptions
- java.lang.Object
-
- com.kristensoft.kdc.SocketOptions
-
public abstract class SocketOptions extends Object
Defines common socket configuration options used by KDC communication transports.This abstract class provides shared configuration for address reuse, receive and send buffer sizes, and IP traffic class. Transport-specific socket options extend this class to provide additional configuration capabilities.
Options that are not explicitly configured retain a
nullvalue, allowing the underlying socket implementation to use its default settings.Applications typically configure socket options using the builders provided by the transport-specific subclasses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSocketOptions.Builder<T extends SocketOptions.Builder<T>>Base builder for configuring common socket options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetReceiveBufferSize()Returns the configured socket receive buffer size.BooleangetReuseAddress()Returns the configured address reuse setting.IntegergetSendBufferSize()Returns the configured socket send buffer size.IntegergetTrafficClass()Returns the configured IP traffic class.booleanhasReceiveBufferSize()Indicates whether the receive buffer size was explicitly configured.booleanhasReuseAddress()Indicates whether address reuse was explicitly configured.booleanhasSendBufferSize()Indicates whether the send buffer size was explicitly configured.booleanhasTrafficClass()Indicates whether the IP traffic class was explicitly configured.
-
-
-
Method Detail
-
getReuseAddress
public Boolean getReuseAddress()
Returns the configured address reuse setting.- Returns:
- the address reuse setting, or
nullif not explicitly configured
-
hasReuseAddress
public boolean hasReuseAddress()
Indicates whether address reuse was explicitly configured.- Returns:
trueif address reuse was configured, otherwisefalse
-
getReceiveBufferSize
public Integer getReceiveBufferSize()
Returns the configured socket receive buffer size.- Returns:
- the receive buffer size in bytes, or
nullif not explicitly configured
-
hasReceiveBufferSize
public boolean hasReceiveBufferSize()
Indicates whether the receive buffer size was explicitly configured.- Returns:
trueif a receive buffer size was configured, otherwisefalse
-
getSendBufferSize
public Integer getSendBufferSize()
Returns the configured socket send buffer size.- Returns:
- the send buffer size in bytes, or
nullif not explicitly configured
-
hasSendBufferSize
public boolean hasSendBufferSize()
Indicates whether the send buffer size was explicitly configured.- Returns:
trueif a send buffer size was configured, otherwisefalse
-
getTrafficClass
public Integer getTrafficClass()
Returns the configured IP traffic class.- Returns:
- the traffic class value from
0through255, ornullif not configured
-
hasTrafficClass
public boolean hasTrafficClass()
Indicates whether the IP traffic class was explicitly configured.- Returns:
trueif a traffic class was configured, otherwisefalse
-
-