Package io.github.mahmoudimus.quic
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 Summary
Modifier and TypeMethodDescriptiondefault voidclosed(QuicConnection connection, QuicConnection.Stats stats, ConnectionError reason, boolean handshakeCompleted) A connection opened has ended, for any reason.default voidhandshakeCompleted(QuicConnection connection, Duration elapsed) A connection's handshake completed.default voidopened(QuicConnection connection) A connection started: a client's, or one a server is accepting (before its handshake).
-
Method Details
-
opened
A connection started: a client's, or one a server is accepting (before its handshake).- Parameters:
connection- the connection
-
handshakeCompleted
A connection's handshake completed.- Parameters:
connection- the connectionelapsed- 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 connectionstats- its statistics at the endreason- why it endedhandshakeCompleted- whether its handshake had completed
-