Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

QUIC transports

dnet provides wrappers around Quinn primitives. The QUIC implementation includes both reliable stream-based transports over SendStream/RecvStream and an unreliable datagram transport over Connection.

Available transports

Reliable QUIC streams

QuicTransport is the most convenient option for typical message passing over QUIC streams. It composes QuicFramedTransport with dnet::io::length_delimited::Codec.

QuicTransport supports:

  • bidirectional streams (wrapping SendStream and RecvStream).
  • unidirectional send-only and receive-only streams (wrapping SendStream or RecvStream).
  • buffered versions for better throughput on many small messages.
  • configurable maximum message length.

Note

This is a reliable transport.
Reliable delivery and in-order delivery are handled by QUIC stream semantics.

Unreliable QUIC datagrams

QuicUnreliableTransport wraps a quinn::Connection and uses QUIC datagrams for message transport.

This transport inherits QUIC datagram semantics:

  • unreliable: messages may be dropped.
  • unordered: messages can arrive out of order.
  • duplicate delivery is possible.
  • messages are bounded by the underlying datagram size.

QuicUnreliableTransport can be configured with Configuration to:

Warning

This is an unreliable transport.
Messages may be dropped, arrive out of order, or be delivered multiple times.

When to use which transport

  • Use QuicTransport when you need a reliable, stream-based message channel.
  • Use QuicFramedTransport when you want a custom framing codec on top of QUIC streams.
  • Use QuicUnreliableTransport when you want datagram-style messaging with lower latency and no reliability guarantees.

Example

See QUIC example.