Skip to content

Wire up unreliable datagram transport - #117

Draft
aryan-25 wants to merge 1 commit into
swift-server:mainfrom
aryan-25:datagrams
Draft

Wire up unreliable datagram transport#117
aryan-25 wants to merge 1 commit into
swift-server:mainfrom
aryan-25:datagrams

Conversation

@aryan-25

Copy link
Copy Markdown
Collaborator

Motivation

In #106, we introduced high-level APIs for reading/writing unreliable HTTP/3 datagrams. In that change, the datagram readers and writers were not wired up to the underlying unreliable datagram transport because swift-nio-http3 did not provide datagram APIs at that time. However, following from apple/swift-nio-http3#18 which introduced the HTTP3Datagram type, we can make some progress in wiring up the datagram transport.

Modifications

  • Added a stub HTTP3DatagramHandler which is just a placeholder for the handler that swift-nio-http3 will provide. That handler will operate on the connection channel.

  • Added HTTP3DatagramDemultiplexer, which is a channel handler that is placed after HTTP3DatagramHandler. This handler simply just reads the stream ID from the HTTP3Datagram and routes the datagram to the request stream (if registered).

  • Added HTTP3UnreliableDatagramStream, which wraps over an AsyncStream and is the source/sink for the datagram reader and writer that are vended in the request stream. This type also buffers a bounded (and configurable) number of datagrams.

  • Added configuration types.

Result

Support for reading/writing unreliable datagrams introduced.

@aryan-25 aryan-25 added the 🆕 semver/minor Adds new public API. label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant