Skip to content

Connection API

connection

Core WebTransport connection object representing a QUIC connection.

ConnectionDiagnostics dataclass

Encapsulate connection diagnostic data.

WebTransportConnection

Manage the high-level WebTransport connection over the shared multiplexing driver.

config property

config: ClientConfig | ServerConfig

Return the configuration associated with this connection.

handle property

handle: ConnectionHandle

Return the unique handle for this connection.

is_client property

is_client: bool

Return True if this is a client-side connection.

is_closed property

is_closed: bool

Return True if the connection is closed.

is_closing property

is_closing: bool

Return True if the connection is closing.

is_connected property

is_connected: bool

Return True if the connection is established.

local_addresses property

local_addresses: list[Address]

Return the local addresses of the connection.

remote_address property

remote_address: Address | None

Return the remote address of the connection.

state property

state: ConnectionState

Return the current state of the connection.

accept classmethod

accept(*, controller: EndpointController, handle: int, config: ServerConfig) -> WebTransportConnection

Instantiate a connection wrapper for an accepted server connection.

close async

close(*, error_code: int = ErrorCodes.APP_NO_ERROR, reason: str = 'wt_connection close') -> None

Terminate the WebTransport connection.

create_session async

create_session(*, authority: str, path: str, headers: Headers | None = None, wt_available_protocols: list[str] | None = None) -> WebTransportSession

Initiate a new WebTransport session.

diagnostics async

diagnostics() -> ConnectionDiagnostics

Retrieve diagnostic information about the connection.

execute_request async

execute_request(*, event_factory: Callable[[int], ProtocolEvent]) -> Any

Execute an asynchronous IPC request via the controller.

get_all_sessions

get_all_sessions() -> list[WebTransportSession]

Retrieve a list of all active session handles.

graceful_shutdown async

graceful_shutdown() -> None

Initiate a graceful shutdown of the connection.