Skip to content

Events

Import event classes through qh3.quic_events and qh3.h3_events.

QUIC events

QuicEvent

Base class for QUIC events.

ConnectionIdIssued dataclass

Bases: QuicEvent

ConnectionIdRetired dataclass

Bases: QuicEvent

ConnectionTerminated dataclass

Bases: QuicEvent

The ConnectionTerminated event is fired when the QUIC connection is terminated.

error_code instance-attribute

error_code

The error code which was specified when closing the connection.

frame_type instance-attribute

frame_type

The frame type which caused the connection to be closed, or None.

reason_phrase instance-attribute

reason_phrase

The human-readable reason for which the connection was closed.

DatagramFrameReceived dataclass

Bases: QuicEvent

The DatagramFrameReceived event is fired when a DATAGRAM frame is received.

data instance-attribute

data

The data which was received.

HandshakeCompleted dataclass

Bases: QuicEvent

The HandshakeCompleted event is fired when the TLS handshake completes.

alpn_protocol instance-attribute

alpn_protocol

The protocol which was negotiated using ALPN, or None.

early_data_accepted instance-attribute

early_data_accepted

Whether early (0-RTT) data was accepted by the remote peer.

session_resumed instance-attribute

session_resumed

Whether a TLS session was resumed.

PingAcknowledged dataclass

Bases: QuicEvent

The PingAcknowledged event is fired when a PING frame is acknowledged.

uid instance-attribute

uid

The unique ID of the PING.

ProtocolNegotiated dataclass

Bases: QuicEvent

The ProtocolNegotiated event is fired when ALPN negotiation completes.

alpn_protocol instance-attribute

alpn_protocol

The protocol which was negotiated using ALPN, or None.

StopSendingReceived dataclass

Bases: QuicEvent

The StopSendingReceived event is fired when the remote peer requests stopping data transmission on a stream.

error_code instance-attribute

error_code

The error code that was sent from the peer.

stream_id instance-attribute

stream_id

The ID of the stream that the peer requested stopping data transmission.

StreamDataReceived dataclass

Bases: QuicEvent

The StreamDataReceived event is fired whenever data is received on a stream.

data instance-attribute

data

The data which was received.

end_stream instance-attribute

end_stream

Whether the STREAM frame had the FIN bit set.

stream_id instance-attribute

stream_id

The ID of the stream the data was received for.

StreamReset dataclass

Bases: QuicEvent

The StreamReset event is fired when the remote peer resets a stream.

error_code instance-attribute

error_code

The error code that triggered the reset.

stream_id instance-attribute

stream_id

The ID of the stream that was reset.

HTTP/3 events

H3Event

Base class for HTTP/3 events.

DataReceived dataclass

Bases: H3Event

The DataReceived event is fired whenever data is received on a stream from the remote peer.

data instance-attribute

data

The data which was received.

stream_id instance-attribute

stream_id

The ID of the stream the data was received for.

stream_ended instance-attribute

stream_ended

Whether the STREAM frame had the FIN bit set.

push_id class-attribute instance-attribute

push_id = None

The Push ID or None if this is not a push.

DatagramReceived dataclass

Bases: H3Event

The DatagramReceived is fired whenever a datagram is received from the the remote peer.

data instance-attribute

data

The data which was received.

flow_id instance-attribute

flow_id

The ID of the flow the data was received for.

InformationalHeadersReceived dataclass

Bases: H3Event

This event is fired whenever an informational response has been caught inflight! The stream cannot be ended there.

headers instance-attribute

headers

The headers.

stream_id instance-attribute

stream_id

The ID of the stream the headers were received for.

HeadersReceived dataclass

Bases: H3Event

The HeadersReceived event is fired whenever headers are received.

headers instance-attribute

headers

The headers.

stream_id instance-attribute

stream_id

The ID of the stream the headers were received for.

stream_ended instance-attribute

stream_ended

Whether the STREAM frame had the FIN bit set.

push_id class-attribute instance-attribute

push_id = None

The Push ID or None if this is not a push.

PushPromiseReceived dataclass

Bases: H3Event

The PushedStreamReceived event is fired whenever a pushed stream has been received from the remote peer.

headers instance-attribute

headers

The request headers.

push_id instance-attribute

push_id

The Push ID of the push promise.

stream_id instance-attribute

stream_id

The Stream ID of the stream that the push is related to.

GoawayReceived dataclass

Bases: H3Event

The GoawayReceived event is fired when a GOAWAY frame is received, indicating graceful shutdown. Streams with IDs >= stream_id were not processed and may be retried on a new connection.

stream_id instance-attribute

stream_id

The stream ID beyond which no requests were processed.

WebTransportStreamDataReceived dataclass

Bases: H3Event

The WebTransportStreamDataReceived is fired whenever data is received for a WebTransport stream.

data instance-attribute

data

The data which was received.

stream_id instance-attribute

stream_id

The ID of the stream the data was received for.

stream_ended instance-attribute

stream_ended

Whether the STREAM frame had the FIN bit set.

session_id instance-attribute

session_id

The ID of the session the data was received for.

StreamReset dataclass

Bases: H3Event

Fired when the remote peer abruptly resets a request stream (RFC 9000 RESET_STREAM). The stream will produce no further events.

stream_id instance-attribute

stream_id

The ID of the stream that was reset.

error_code instance-attribute

error_code

The application error code carried by the RESET_STREAM frame.

StopSending dataclass

Bases: H3Event

Fired when the remote peer asks us to stop sending on a stream (RFC 9000 STOP_SENDING). The local sender side has been reset.

stream_id instance-attribute

stream_id

The ID of the stream the peer asked us to stop sending on.

error_code instance-attribute

error_code

The application error code carried by the STOP_SENDING frame.