Skip to content

HandshakeHandler

veltix.handler.handshake_handler.HandshakeHandler

Handles the HELLO / HELLO_ACK exchange for a single connection.

SERVER: prepare_hello() → send_hello() → handle_hello_ack() CLIENT: handle_hello() → send_hello_ack()

prepare_hello

prepare_hello() -> tuple[bytes, Request]

Prepare a HELLO request without sending it.

Must be called BEFORE register() and send_hello() to avoid the race condition where HELLO_ACK arrives before the queue is registered.

send_hello

send_hello(hello: Request, client_conn=None) -> None

Send a previously prepared HELLO. Must be called AFTER register().

handle_hello_ack

handle_hello_ack(response: Response) -> bool

Validate an incoming HELLO_ACK from the client.

handle_hello

handle_hello(response: Response) -> bool

Validate an incoming HELLO from the server.

send_hello_ack

send_hello_ack(request_id: bytes) -> None

Send HELLO_ACK back to the server.