TsgcWebTransportSession › Events

TsgcWebTransportSession Events

Three events for applications, plus three transport hooks that the HTTP/3 client and server assign for you.

Application Events

Assign these from your own code. Assign OnStream before the session can receive anything, that is, inside OnWebTransportSession on the server, or immediately after WebTransportConnect returns on the client.

NameDescription
OnStreamFires when the peer opens a new stream inside this session.
OnDatagramWould deliver an inbound datagram payload. Never fires as shipped.
OnCloseFires when Close is called on this session.

Transport Hooks

These are declared as event properties, but they belong to the transport, not to the application. TsgcHTTP3Client.WebTransportConnect and the server's session-accept path assign all three before you ever see the session. Overwriting one breaks the session's ability to write. They are documented because a custom QUIC transport must supply them.

NameDescription
OnOpenStreamLets the transport allocate the real QUIC stream backing an OpenStream call.
OnWriteDataSession-level fallback writer, used when a stream has no per-stream writer.
OnSendDatagramDataReceives the encoded datagram packet from SendDatagram. Bound to a no-op as shipped, and never reached, since SendDatagram raises first.

All Events (alphabetical)

NameDescription
OnCloseFires when Close is called on this session.
OnDatagramWould deliver an inbound datagram payload. Never fires as shipped.
OnOpenStreamTransport hook: lets the transport allocate the real QUIC stream backing an OpenStream call.
OnSendDatagramDataTransport hook: receives the encoded datagram packet from SendDatagram. Bound to a no-op as shipped, and never reached, since SendDatagram raises first.
OnStreamFires when the peer opens a new stream inside this session.
OnWriteDataTransport hook: session-level fallback writer, used when a stream has no per-stream writer.

Back to TsgcWebTransportSession