Class QuicProtocolConnection

java.lang.Object
org.tentackle.quic.QuicProtocolConnection
All Implemented Interfaces:
tech.kwik.core.server.ApplicationProtocolConnection

public class QuicProtocolConnection extends Object implements tech.kwik.core.server.ApplicationProtocolConnection
The server side of a QUIC connection.
Dispatches each stream a client opens to a TRIP connection handler running on a virtual thread.
  • Constructor Details

    • QuicProtocolConnection

      public QuicProtocolConnection(QuicTripTransport transport, InetSocketAddress peer, MultiplexedConnectionGuard guard, boolean refused)
      Creates a protocol connection.

      The peer's address names each stream's connection, which is what the PreAuthenticationPolicy groups the connection limits by. KWIK's stream names carry only the stream number.

      Parameters:
      transport - the transport the streams belong to
      peer - the client's address, null if unknown
      guard - the guard of the QUIC connection, null if none
      refused - true if the pre-authentication policy refused the QUIC connection: its streams are closed at once
    • QuicProtocolConnection

      public QuicProtocolConnection(QuicTripTransport transport, InetSocketAddress peer)
      Creates a protocol connection without a guard.
      Parameters:
      transport - the transport the streams belong to
      peer - the client's address, null if unknown
    • QuicProtocolConnection

      public QuicProtocolConnection(QuicTripTransport transport)
      Creates a protocol connection for an unknown peer.
      Parameters:
      transport - the transport the streams belong to
  • Method Details

    • getConnectionName

      protected String getConnectionName(tech.kwik.core.QuicStream quicStream)
      Gets the name of a stream's TRIP connection.
      Same format as the one of quiche: "stream <id> of QUIC connection to /<ip>:<port>", so that TransportClientInfo.getHost(String) finds the host.
      Parameters:
      quicStream - the stream
      Returns:
      the connection name
    • acceptPeerInitiatedStream

      public void acceptPeerInitiatedStream(tech.kwik.core.QuicStream quicStream)
      Specified by:
      acceptPeerInitiatedStream in interface tech.kwik.core.server.ApplicationProtocolConnection