|
| virtual | ~Transport ()=default |
| | Destroy the transport after derived-class shutdown has completed. More...
|
| |
| virtual TransportStatus | Status () const =0 |
| | Status of the transport. More...
|
| |
| virtual std::shared_ptr< Connection > | Start ()=0 |
| | Setup the transport connection. More...
|
| |
| virtual std::shared_ptr< Connection > | Connect (const TransportRemote &remote)=0 |
| |
| virtual void | Close (const std::shared_ptr< Connection > &connection, AppReasonForClose app_reason=AppReasonForClose::kRemoteRequestClose)=0 |
| | Close a transport context. More...
|
| |
| virtual void | CloseStream (const std::shared_ptr< Stream > &stream, StreamOperation operation)=0 |
| | Close a stream. More...
|
| |
| virtual bool | Enqueue (const std::shared_ptr< Connection > &connection, const std::shared_ptr< Stream > &stream, std::shared_ptr< const std::vector< uint8_t >> bytes, uint8_t priority=1, uint32_t ttl_ms=350, EnqueueFlags flags={ true, false, false, false })=0 |
| | Enqueue application data on a stream. More...
|
| |
| virtual void | EnqueueDatagram (const std::shared_ptr< Connection > &connection, std::shared_ptr< const std::vector< uint8_t >> bytes, uint8_t priority=1, uint32_t ttl_ms=350)=0 |
| | Enqueue application data as a datagram. More...
|
| |
| virtual std::shared_ptr< const std::vector< uint8_t > > | Dequeue (const std::shared_ptr< Connection > &connection)=0 |
| | Dequeue datagram application data from transport buffer. More...
|
| |
| virtual int | CloseWebTransportSession (const std::shared_ptr< Connection > &connection, uint32_t error_code, const char *error_msg=nullptr)=0 |
| | Close a WebTransport session with error code and message. More...
|
| |
| virtual int | DrainWebTransportSession (const std::shared_ptr< Connection > &connection)=0 |
| | Drain a WebTransport session gracefully. More...
|
| |
| virtual std::shared_ptr< Stream > | CreateDataStream (const std::shared_ptr< Connection > &connection, uint8_t priority)=0 |
| | Create a unidirectional stream to publish objects on. More...
|
| |
| virtual std::shared_ptr< Stream > | CreateControlStream (const std::shared_ptr< Connection > &connection)=0 |
| | Create the connection's unidirectional outbound control stream. More...
|
| |
| virtual std::shared_ptr< Stream > | CreateRequestStream (const std::shared_ptr< Connection > &connection)=0 |
| | Create a bidirectional request stream. More...
|
| |
| virtual void | Shutdown () |
| | Stop network threads and release transport resources. More...
|
| |
Transport interface.
Implementations own asynchronous network and notification queues. Public operations marshal work to the transport as needed; callbacks are delivered serially on the transport notification thread. Callback implementations must return promptly to avoid delaying unrelated connection and stream events.
| virtual int quicr::Transport::CloseWebTransportSession |
( |
const std::shared_ptr< Connection > & |
connection, |
|
|
uint32_t |
error_code, |
|
|
const char * |
error_msg = nullptr |
|
) |
| |
|
pure virtual |
Close a WebTransport session with error code and message.
Sends a CLOSE_WEBTRANSPORT_SESSION capsule to gracefully close the WebTransport session. This is only valid for connections using WebTransport over HTTP/3. For raw QUIC connections, this method has no effect.
The close session message allows the application to provide:
- An error code to indicate the reason for closure
- An optional error message string for debugging
After sending the close session message, the WebTransport session will be terminated and all associated streams will be cleaned up. This is typically used when the application wants to explicitly close the session due to an error condition or when normal session termination is required.
- Parameters
-
| connection | WebTransport connection to close. |
| error_code | WebTransport error code (application-defined) |
| error_msg | Optional error message string (can be nullptr) |
- Returns
- 0 on success, -1 on failure (e.g., not a WebTransport connection)
| virtual int quicr::Transport::DrainWebTransportSession |
( |
const std::shared_ptr< Connection > & |
connection | ) |
|
|
pure virtual |
Drain a WebTransport session gracefully.
Sends a DRAIN_WEBTRANSPORT_SESSION capsule to indicate that the peer should finish sending any pending data and then close the session. This is a more graceful shutdown compared to CloseWebTransportSession, allowing both peers to complete ongoing operations before closure.
The drain message signals to the peer that:
- No new operations should be started
- Existing operations should be completed
- The session will be closed after all pending data is sent
This is typically used during normal application shutdown when you want to ensure all data is properly flushed before closing the connection.
Only valid for WebTransport connections. For raw QUIC connections, this method has no effect.
- Parameters
-
| connection | WebTransport connection to drain. |
- Returns
- 0 on success, -1 on failure (e.g., not a WebTransport connection)