Interface QuicServer
- All Superinterfaces:
Measured, QuicEndpoint
-
Method Summary
Modifier and TypeMethodDescriptionconnectHandler(Handler<QuicConnection> handler) Set the handler processingQuicConnection, the handler must be set before the server is bound.exceptionHandler(Handler<Throwable> handler) Set an exception handler called for socket errors happening before the QUIC connection is established, e.g. during the TLS handshake.listen()Start listening on theportandhostas configured in theQuicServerConfigused when creating the server.default Future<SocketAddress> listen(int port) Start listening on the specified port and host "0.0.0.0".default Future<SocketAddress> Start listening on the specifiedportandhost.default Future<SocketAddress> listen(SocketAddress localAddress) Start listening on the specified local address.default QuicServerstreamHandler(Handler<QuicStream> handler) Set a handler processing incoming Quic streams, this is a short-cut ofserver.connectHandler(connection -> connection.streamHandler(stream)).updateSSLOptions(ServerSSLOptions options) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptions(ServerSSLOptions options, boolean force) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.Methods inherited from interface Measured
isMetricsEnabledMethods inherited from interface QuicEndpoint
bind, close, shutdown, shutdown
-
Method Details
-
connectHandler
Set the handler processingQuicConnection, the handler must be set before the server is bound.- Parameters:
handler- the connection handler- Returns:
- this object instance
-
streamHandler
Set a handler processing incoming Quic streams, this is a short-cut ofserver.connectHandler(connection -> connection.streamHandler(stream)).- Parameters:
handler- the handler processing streams- Returns:
- this object instance
-
exceptionHandler
Set an exception handler called for socket errors happening before the QUIC connection is established, e.g. during the TLS handshake.- Parameters:
handler- the handler to set- Returns:
- a reference to this, so the API can be used fluently
-
listen
Future<SocketAddress> listen()Start listening on theportandhostas configured in theQuicServerConfigused when creating the server.- Returns:
- a future signaling the success or failure of the listen operation, the result is socket address this endpoint is bound to
-
listen
Start listening on the specifiedportandhost.Port
0can be specified meaning "choose a random port".Host
0.0.0.0can be specified meaning "listen on all available interfaces".- Returns:
- a future signaling the success or failure of the listen operation, the result is socket address this endpoint is bound to
-
listen
Start listening on the specified port and host "0.0.0.0".Port
0can be specified meaning "choose an random port".- Returns:
- a future signaling the success or failure of the listen operation, the result is socket address this endpoint is bound to
-
listen
Start listening on the specified local address.- Parameters:
localAddress- the local address to listen on- Returns:
- a future signaling the success or failure of the listen operation, the result is socket address this endpoint is bound to
-
updateSSLOptions
Update the server with new SSL
options, the update happens if the options object is valid and different from the existing options object.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options- the new SSL options- Returns:
- a future signaling the update success
-
updateSSLOptions
Update the server with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, settingforcetotrueforces the update.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- a future signaling the update success
-