Interface QuicConnection.Observer

Enclosing class:
QuicConnection

public static interface QuicConnection.Observer
Learns of an endpoint's connections as they open, complete their handshakes and close, for statistics: set with QuicServer.observe(io.github.mahmoudimus.quic.QuicConnection.Observer) or QuicClient.observe(io.github.mahmoudimus.quic.QuicConnection.Observer). Its methods run on the connection's own thread, never with the connection's lock held, and must not block; an exception they throw is logged and otherwise ignored.
  • Method Details

    • opened

      default void opened(QuicConnection connection)
      A connection started: a client's, or one a server is accepting (before its handshake).
      Parameters:
      connection - the connection
    • handshakeCompleted

      default void handshakeCompleted(QuicConnection connection, Duration elapsed)
      A connection's handshake completed.
      Parameters:
      connection - the connection
      elapsed - how long since the connection started
    • closed

      default void closed(QuicConnection connection, QuicConnection.Stats stats, ConnectionError reason, boolean handshakeCompleted)
      A connection opened has ended, for any reason.
      Parameters:
      connection - the connection
      stats - its statistics at the end
      reason - why it ended
      handshakeCompleted - whether its handshake had completed