Interface QuicServer

All Superinterfaces:
Measured, QuicEndpoint

public interface QuicServer extends QuicEndpoint
A Quic server.
Author:
Julien Viet
  • Method Details

    • connectHandler

      QuicServer connectHandler(Handler<QuicConnection> handler)
      Set the handler processing QuicConnection, the handler must be set before the server is bound.
      Parameters:
      handler - the connection handler
      Returns:
      this object instance
    • streamHandler

      default QuicServer streamHandler(Handler<QuicStream> handler)
      Set a handler processing incoming Quic streams, this is a short-cut of server.connectHandler(connection -> connection.streamHandler(stream)).
      Parameters:
      handler - the handler processing streams
      Returns:
      this object instance
    • exceptionHandler

      QuicServer 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.
      Parameters:
      handler - the handler to set
      Returns:
      a reference to this, so the API can be used fluently
    • listen

      Start listening on the port and host as configured in the QuicServerConfig used 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

      default Future<SocketAddress> listen(int port, String host)
      Start listening on the specified port and host.

      Port 0 can be specified meaning "choose a random port".

      Host 0.0.0.0 can 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

      default Future<SocketAddress> listen(int port)
      Start listening on the specified port and host "0.0.0.0".

      Port 0 can 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

      default Future<SocketAddress> listen(SocketAddress localAddress)
      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

      default Future<Boolean> updateSSLOptions(ServerSSLOptions options)

      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

      Future<Boolean> updateSSLOptions(ServerSSLOptions options, boolean force)

      Update the server with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method 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, setting force to true forces the update.

      The boolean succeeded future result indicates whether the update occurred.

      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      a future signaling the update success