blackbull.server.http2_ws¶
blackbull.server.http2_ws
¶
HTTP/2 WebSocket byte-stream adapters (RFC 8441).
HTTP2WSReader and HTTP2WSWriter bridge between the HTTP/2 DATA frame layer and the RFC 6455 WebSocket codec (ws_codec.py).
HTTP2WSReader — AbstractReader backed by DATA frame payloads pushed by HTTP2Actor._on_data_frame(). Implements the same put_DATAFrame / put_disconnect interface as HTTP2Recipient so the existing _signal_recipients() helper and _on_data_frame() dispatch work without modification.
HTTP2WSWriter — AbstractWriter that wraps an HTTP2Sender and translates raw WebSocket frame bytes into http.response.body events (inheriting HTTP/2 flow control from the sender). close() sends a final empty DATA+END_STREAM to signal orderly HTTP/2 stream termination per RFC 8441 §5.
HTTP2WSReader
¶
Bases: AbstractReader
Byte-buffer AbstractReader fed by HTTP/2 DATA frames.
ws_codec.read_frame_header / read_payload call readexactly(n); this class buffers raw DATA frame payloads and serves exact-length reads, blocking until enough bytes arrive or EOF is signalled.
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).