Class Http3StreamValidator.UnidirectionalStreams

java.lang.Object
io.github.mahmoudimus.http3.Http3StreamValidator.UnidirectionalStreams
Enclosing class:
Http3StreamValidator

public static final class Http3StreamValidator.UnidirectionalStreams extends Object
The peer's unidirectional streams (RFC 9114 §6.2, RFC 9204 §4.2): at most one control stream, one QPACK encoder stream and one QPACK decoder stream, and push streams only from a server. Not thread-safe.
  • Constructor Details

    • UnidirectionalStreams

      public UnidirectionalStreams(Http3StreamValidator.Role local)
      Tracks the peer's unidirectional streams.
      Parameters:
      local - which end this endpoint is
  • Method Details

    • onStream

      public boolean onStream(long type) throws Http3Exception
      Checks a new stream of the given type.
      Parameters:
      type - the stream type
      Returns:
      true if the stream is to be read; false for an unknown or reserved type, whose stream the caller abandons (reading stopped with H3_STREAM_CREATION_ERROR) or discards
      Throws:
      Http3Exception - a connection error H3_STREAM_CREATION_ERROR for a second control, encoder or decoder stream, or a push stream opened by a client
    • onStreamClosed

      public void onStreamClosed(long type) throws Http3Exception
      Reports that a stream of this type ended or was reset.
      Parameters:
      type - the stream type
      Throws:
      Http3Exception - a connection error H3_CLOSED_CRITICAL_STREAM for a control, encoder or decoder stream