-
- All Known Subinterfaces:
ServerConfiguration
public interface SocketConfigurationThe SocketConfiguration configures a port to listen on and its associated server socket parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSocketConfiguration.BuilderTheSocketConfigurationbuilder class.static interfaceSocketConfiguration.SocketConfigurationBuilder<B extends SocketConfiguration.SocketConfigurationBuilder<B>>
-
Field Summary
Fields Modifier and Type Field Description static SocketConfigurationDEFAULTDeprecated.since 2.0.0 This configuration does not contain a name and will be removedstatic intDEFAULT_BACKLOG_SIZEThe default backlog size to configure the server sockets with if no other value is provided.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intbacklog()Returns a maximum length of the queue of incoming connections on the server socket.InetAddressbindAddress()Returns local address where the server listens on with the server socket.static SocketConfiguration.Builderbuilder()Creates a builder ofSocketConfigurationclass.ClientAuthenticationclientAuth()Whether to require client authentication or not.static SocketConfigurationcreate(String name)Create a default named configuration.default booleanenabled()Whether this socket is enabled (and will be opened on server startup), or disabled (and ignored on server startup).Set<String>enabledSslProtocols()Returns the SSL protocols to enable, ornullto enable the default protocols.default Stringname()Name of this socket.intport()Returns a server port to listen on with the server socket.intreceiveBufferSize()Returns proposed value of the TCP receive window that is advertised to the remote peer on the server socket.SSLContextssl()Returns aSSLContextto use with the server socket.inttimeoutMillis()Returns a server socket timeout in milliseconds or0for an infinite timeout.
-
-
-
Field Detail
-
DEFAULT
@Deprecated static final SocketConfiguration DEFAULT
Deprecated.since 2.0.0 This configuration does not contain a name and will be removedThe default socket configuration.
-
DEFAULT_BACKLOG_SIZE
static final int DEFAULT_BACKLOG_SIZE
The default backlog size to configure the server sockets with if no other value is provided.- See Also:
- Constant Field Values
-
-
Method Detail
-
name
default String name()
Name of this socket. Default toWebServer.DEFAULT_SOCKET_NAMEfor the main and default server socket. All other sockets must be named.- Returns:
- name of this socket
-
port
int port()
Returns a server port to listen on with the server socket. If port is0then any available ephemeral port will be used.- Returns:
- the server port of the server socket
-
bindAddress
InetAddress bindAddress()
Returns local address where the server listens on with the server socket. Ifnullthen listens an all local addresses.- Returns:
- an address to bind with the server socket;
nullfor all local addresses
-
backlog
int backlog()
Returns a maximum length of the queue of incoming connections on the server socket.Default value is
DEFAULT_BACKLOG_SIZE.- Returns:
- a maximum length of the queue of incoming connections
-
timeoutMillis
int timeoutMillis()
Returns a server socket timeout in milliseconds or0for an infinite timeout.- Returns:
- a server socket timeout in milliseconds or
0
-
receiveBufferSize
int receiveBufferSize()
Returns proposed value of the TCP receive window that is advertised to the remote peer on the server socket.If
0then use implementation default.- Returns:
- a buffer size in bytes of the server socket or
0
-
ssl
SSLContext ssl()
Returns aSSLContextto use with the server socket. If notnullthen the server enforces an SSL communication.- Returns:
- a SSL context to use
-
enabledSslProtocols
Set<String> enabledSslProtocols()
Returns the SSL protocols to enable, ornullto enable the default protocols.- Returns:
- the SSL protocols to enable
-
clientAuth
ClientAuthentication clientAuth()
Whether to require client authentication or not.- Returns:
- client authentication
-
enabled
default boolean enabled()
Whether this socket is enabled (and will be opened on server startup), or disabled (and ignored on server startup).- Returns:
truefor enabled socket,falsefor socket that should not be opened
-
builder
static SocketConfiguration.Builder builder()
Creates a builder ofSocketConfigurationclass.- Returns:
- a builder
-
create
static SocketConfiguration create(String name)
Create a default named configuration.- Parameters:
name- name of the socket- Returns:
- a new socket configuration with defaults
-
-