- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
SocketOptions.BuilderBase.SocketOptionsImpl
Socket options.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent API builder forSocketOptions
.static class
SocketOptions.BuilderBase<BUILDER extends SocketOptions.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends SocketOptions> Fluent API builder base forSocketOptions
. -
Method Summary
Modifier and TypeMethodDescriptionstatic SocketOptions.Builder
builder()
Create a new fluent API builder to customize configuration.static SocketOptions.Builder
builder
(SocketOptions instance) Create a new fluent API builder from an existing instance.default void
configureSocket
(Socket socket) Configure socket with defined socket options.Socket connect timeout.static SocketOptions
create()
Create a new instance with default values.static SocketOptions
Create a new instance from configuration.Socket read timeout.boolean
Configure socket keep alive.Map
<SocketOption<?>, Object> Arbitrary socket options.Socket receive buffer size.boolean
Socket reuse address.Socket send buffer size.boolean
This option may improve performance on some systems.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
socketOptions
Map<SocketOption<?>,Object> socketOptions()Arbitrary socket options. Socket options that have dedicated methods in this type will be ignored if configured within the map.- Returns:
- custom socket options
-
connectTimeout
Duration connectTimeout()Socket connect timeout. Default is 10 seconds.- Returns:
- connect timeout duration
-
readTimeout
Duration readTimeout()Socket read timeout. Default is 30 seconds.- Returns:
- read timeout duration
-
socketReceiveBufferSize
Socket receive buffer size.- Returns:
- buffer size, in bytes
- See Also:
-
socketSendBufferSize
Socket send buffer size.- Returns:
- buffer size, in bytes
- See Also:
-
socketReuseAddress
boolean socketReuseAddress()Socket reuse address. Default istrue
.- Returns:
- whether to reuse address
- See Also:
-
socketKeepAlive
boolean socketKeepAlive()Configure socket keep alive. Default istrue
.- Returns:
- keep alive
- See Also:
-
tcpNoDelay
boolean tcpNoDelay()This option may improve performance on some systems. Default isfalse
.- Returns:
- whether to use TCP_NODELAY, defaults to
false
- See Also:
-
configureSocket
Configure socket with defined socket options.- Parameters:
socket
- socket to update
-