Package io.helidon.webserver
Interface SocketConfiguration
-
- All Known Subinterfaces:
ServerConfiguration
public interface SocketConfiguration
The SocketConfiguration configures a port to listen on and its associated server socket parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SocketConfiguration.Builder
TheSocketConfiguration
builder class.
-
Field Summary
Fields Modifier and Type Field Description static SocketConfiguration
DEFAULT
The default socket configuration.static int
DEFAULT_BACKLOG_SIZE
The 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 Modifier and Type Method Description int
backlog()
Returns a maximum length of the queue of incoming connections on the server socket.InetAddress
bindAddress()
Returns local address where the server listens on with the server socket.static SocketConfiguration.Builder
builder()
Creates a builder ofSocketConfiguration
class.Set<String>
cipherSuite()
Allowed cipher suite of the socket TLS.ClientAuthentication
clientAuth()
Whether to require client authentication or not.Set<String>
enabledSslProtocols()
Returns the SSL protocols to enable, ornull
to enable the default protocols.int
initialBufferSize()
Initial size of the buffer used to parse HTTP line and headers.int
maxChunkSize()
Maximal size of a single chunk of received data.int
maxHeaderSize()
Maximal size of all headers combined.int
maxInitialLineLength()
Maximal length of the initial HTTP line.int
port()
Returns a server port to listen on with the server socket.int
receiveBufferSize()
Returns proposed value of the TCP receive window that is advertised to the remote peer on the server socket.SSLContext
ssl()
Returns aSSLContext
to use with the server socket.int
timeoutMillis()
Returns a server socket timeout in milliseconds or0
for an infinite timeout.boolean
validateHeaders()
Whether to validate HTTP header names.
-
-
-
Field Detail
-
DEFAULT
static final SocketConfiguration DEFAULT
The 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
-
port
int port()
Returns a server port to listen on with the server socket. If port is0
then 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. Ifnull
then listens an all local addresses.- Returns:
- an address to bind with the server socket;
null
for 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 or0
for 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
0
then use implementation default.- Returns:
- a buffer size in bytes of the server socket or
0
-
ssl
SSLContext ssl()
Returns aSSLContext
to use with the server socket. If notnull
then the server enforces an SSL communication.- Returns:
- a SSL context to use
-
enabledSslProtocols
Set<String> enabledSslProtocols()
Returns the SSL protocols to enable, ornull
to enable the default protocols.- Returns:
- the SSL protocols to enable
-
clientAuth
ClientAuthentication clientAuth()
Whether to require client authentication or not.- Returns:
- client authentication
-
maxHeaderSize
int maxHeaderSize()
Maximal size of all headers combined.- Returns:
- size in bytes
-
maxInitialLineLength
int maxInitialLineLength()
Maximal length of the initial HTTP line.- Returns:
- length
-
maxChunkSize
int maxChunkSize()
Maximal size of a single chunk of received data.- Returns:
- chunk size
-
validateHeaders
boolean validateHeaders()
Whether to validate HTTP header names. When set totrue
, we make sure the header name is a valid string- Returns:
true
if headers should be validated
-
initialBufferSize
int initialBufferSize()
Initial size of the buffer used to parse HTTP line and headers.- Returns:
- initial size of the buffer
-
builder
static SocketConfiguration.Builder builder()
Creates a builder ofSocketConfiguration
class.- Returns:
- a builder
-
-