Skip to content

blackbull.server.http2_ws

blackbull.server.http2_ws

RFC 8441 byte-stream adapters. Reuse the HTTP/2 connection factory and flow control; do not create another HPACK context.

HTTP2StreamReader

Bases: AbstractReader

One stream's DATA as the WebSocket codec's byte stream, in either role.

Credit returns as octets are consumed, padding included, so at most budget octets are ever unconsumed and DATA past that is refused. Buffered octets a pending read has committed to count as consumed before it waits: otherwise a read longer than the window waits forever.

put_DATAFrame(frame)

Buffer frame; False when it overruns the window (the caller resets).

take_uncredited()

Return and clear the credit never returned; the stream is being released.

HTTP2WSWriter

Bases: AbstractWriter

AbstractWriter that sends WebSocket frame bytes as HTTP/2 DATA frames.

Delegates to an HTTP2Sender so HTTP/2 flow control (RFC 7540 §6.9) is honoured transparently. close() sends an empty DATA+END_STREAM to signal orderly HTTP/2 stream termination (RFC 8441 §5).