java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.quic.common.QuicSession
All Implemented Interfaces:
org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

public abstract class QuicSession extends org.eclipse.jetty.util.component.ContainerLifeCycle

Represents a logical connection with a remote peer, identified by a QUIC connection ID.

Each QuicSession maintains a number of QUIC streams, identified by their QUIC stream ID; Each QUIC stream is wrapped in an EndPoint, namely QuicStreamEndPoint.

Bytes received from a QuicConnection in process(SocketAddress, ByteBuffer) are passed to Quiche for processing; in turn, Quiche produces a list of QUIC stream IDs that have pending I/O events, either read-ready or write-ready.

On the receive side, a QuicSession fans-out to multiple QuicStreamEndPoints.

On the send side, many QuicStreamEndPoints fan-in to a QuicSession.

See Also:
  • Constructor Details

    • QuicSession

      protected QuicSession(Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.ByteBufferPool byteBufferPool, org.eclipse.jetty.quic.quiche.QuicheConnection quicheConnection, QuicConnection connection, SocketAddress remoteAddress)
  • Method Details

    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      Exception
    • shutdown

      public CompletableFuture<Void> shutdown()
    • getExecutor

      public Executor getExecutor()
    • getScheduler

      public org.eclipse.jetty.util.thread.Scheduler getScheduler()
    • getByteBufferPool

      public org.eclipse.jetty.io.ByteBufferPool getByteBufferPool()
    • getProtocolSession

      public ProtocolSession getProtocolSession()
    • getMaxLocalStreams

      public int getMaxLocalStreams()
    • getNegotiatedProtocol

      public String getNegotiatedProtocol()
    • getQuicConnection

      public QuicConnection getQuicConnection()
    • getQuicStreamEndPoints

      public Collection<QuicStreamEndPoint> getQuicStreamEndPoints()
    • getRemoteCloseInfo

      public CloseInfo getRemoteCloseInfo()
    • getIdleTimeout

      public long getIdleTimeout()
    • setIdleTimeout

      public void setIdleTimeout(long idleTimeout)
    • onIdleTimeout

      public boolean onIdleTimeout()
    • onFailure

      public void onFailure(Throwable failure)
    • newStreamId

      public long newStreamId(StreamType streamType)
      Parameters:
      streamType - the stream type
      Returns:
      a new stream ID for the given type
    • fill

      public int fill(long streamId, ByteBuffer buffer) throws IOException
      Throws:
      IOException
    • flush

      public int flush(long streamId, ByteBuffer buffer, boolean last) throws IOException
      Throws:
      IOException
    • isFinished

      public boolean isFinished(long streamId)
    • getWindowCapacity

      public long getWindowCapacity()
    • getWindowCapacity

      public long getWindowCapacity(long streamId) throws IOException
      Throws:
      IOException
    • shutdownInput

      public void shutdownInput(long streamId, long error) throws IOException
      Throws:
      IOException
    • shutdownOutput

      public void shutdownOutput(long streamId, long error) throws IOException
      Throws:
      IOException
    • remove

      public void remove(QuicStreamEndPoint endPoint, Throwable failure)
    • getLocalAddress

      public SocketAddress getLocalAddress()
    • getRemoteAddress

      public SocketAddress getRemoteAddress()
    • isConnectionEstablished

      public boolean isConnectionEstablished()
    • getConnectionId

      public org.eclipse.jetty.quic.quiche.QuicheConnectionId getConnectionId()
    • setConnectionId

      public void setConnectionId(org.eclipse.jetty.quic.quiche.QuicheConnectionId quicheConnectionId)
    • process

      public Runnable process(SocketAddress remoteAddress, ByteBuffer cipherBufferIn) throws IOException
      Throws:
      IOException
    • pollTask

      protected Runnable pollTask()
    • createProtocolSession

      protected abstract ProtocolSession createProtocolSession()
    • newConnection

      public abstract org.eclipse.jetty.io.Connection newConnection(QuicStreamEndPoint endPoint)
    • flush

      public void flush()
    • getOrCreateStreamEndPoint

      public QuicStreamEndPoint getOrCreateStreamEndPoint(long streamId, Consumer<QuicStreamEndPoint> consumer)
    • inwardClose

      public void inwardClose(long error, String reason)
    • outwardClose

      public void outwardClose(long error, String reason)
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Specified by:
      dump in interface org.eclipse.jetty.util.component.Dumpable
      Overrides:
      dump in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class org.eclipse.jetty.util.component.AbstractLifeCycle