Class HTTP3Session

All Implemented Interfaces:
Session, ParserListener, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
Direct Known Subclasses:
HTTP3SessionClient, HTTP3SessionServer

public abstract class HTTP3Session extends ContainerLifeCycle implements Session, ParserListener
  • Constructor Details

  • Method Details

    • getProtocolSession

      public ProtocolSession getProtocolSession()
    • getListener

      public Session.Listener getListener()
    • onOpen

      public void onOpen()
    • getLocalSocketAddress

      public SocketAddress getLocalSocketAddress()
      Specified by:
      getLocalSocketAddress in interface Session
      Returns:
      the local socket address this session is bound to
    • getRemoteSocketAddress

      public SocketAddress getRemoteSocketAddress()
      Specified by:
      getRemoteSocketAddress in interface Session
      Returns:
      the remote socket address this session is connected to
    • getStreams

      public Collection<Stream> getStreams()
      Specified by:
      getStreams in interface Session
      Returns:
      a snapshot of all the streams currently belonging to this session
    • getMaxLocalStreams

      public int getMaxLocalStreams()
    • goAway

      public CompletableFuture<Void> goAway(boolean graceful)
      Description copied from interface: Session

      Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.

      Specified by:
      goAway in interface Session
      Parameters:
      graceful - whether the shutdown should be graceful
      Returns:
      the CompletableFuture that gets notified when the frame has been sent
    • newGoAwayFrame

      protected GoAwayFrame newGoAwayFrame(boolean graceful)
    • shutdown

      public CompletableFuture<Void> shutdown()
    • getIdleTimeout

      public long getIdleTimeout()
    • getStreamIdleTimeout

      public long getStreamIdleTimeout()
    • setStreamIdleTimeout

      public void setStreamIdleTimeout(long streamIdleTimeout)
    • createStream

      protected HTTP3Stream createStream(QuicStreamEndPoint endPoint, Consumer<Throwable> fail)
    • getOrCreateStream

      protected HTTP3Stream getOrCreateStream(QuicStreamEndPoint endPoint)
    • newHTTP3Stream

      protected abstract HTTP3Stream newHTTP3Stream(QuicStreamEndPoint endPoint, boolean local)
    • getStream

      protected HTTP3Stream getStream(long streamId)
    • removeStream

      public void removeStream(HTTP3Stream stream, Throwable failure)
    • writeControlFrame

      public abstract void writeControlFrame(Frame frame, Callback callback)
    • writeMessageFrame

      public abstract void writeMessageFrame(long streamId, Frame frame, Callback callback)
    • onPreface

      public Map<Long,Long> onPreface()
    • onSettings

      public void onSettings(SettingsFrame frame)
      Specified by:
      onSettings in interface ParserListener
    • onHeaders

      public void onHeaders(long streamId, HeadersFrame frame, boolean wasBlocked)
      Specified by:
      onHeaders in interface ParserListener
    • onData

      public void onData(long streamId, DataFrame frame)
      Specified by:
      onData in interface ParserListener
    • onDataAvailable

      public void onDataAvailable(long streamId)
    • onGoAway

      public void onGoAway(GoAwayFrame frame)
      Specified by:
      onGoAway in interface ParserListener
    • onIdleTimeout

      public boolean onIdleTimeout()
    • inwardClose

      public void inwardClose(long error, String reason)

      Called when a an external event wants to initiate the close of this session locally, for example a close at the network level (due to e.g. stopping a component) or a timeout.

      The correspondent passive event, where it's the remote peer that initiates the close, is delivered via onClose(long, String).

      Parameters:
      error - the close error
      reason - the close reason
      See Also:
    • onClose

      public void onClose(long error, String reason)

      Called when the local peer receives a close initiated by the remote peer.

      The correspondent active event, where it's the local peer that initiates the close, it's delivered via inwardClose(long, String).

      Parameters:
      error - the close error
      reason - the close reason
    • onStreamFailure

      public void onStreamFailure(long streamId, long error, Throwable failure)
      Specified by:
      onStreamFailure in interface ParserListener
    • onSessionFailure

      public void onSessionFailure(long error, String reason, Throwable failure)
      Specified by:
      onSessionFailure in interface ParserListener
    • isClosed

      public boolean isClosed()
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      Overrides:
      dump in class ContainerLifeCycle
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLifeCycle