Wire up unreliable datagram transport - #117
Draft
aryan-25 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-http3did not provide datagram APIs at that time. However, following from apple/swift-nio-http3#18 which introduced theHTTP3Datagramtype, we can make some progress in wiring up the datagram transport.Modifications
Added a stub
HTTP3DatagramHandlerwhich is just a placeholder for the handler thatswift-nio-http3will provide. That handler will operate on the connection channel.Added
HTTP3DatagramDemultiplexer, which is a channel handler that is placed afterHTTP3DatagramHandler. This handler simply just reads the stream ID from theHTTP3Datagramand routes the datagram to the request stream (if registered).Added
HTTP3UnreliableDatagramStream, which wraps over anAsyncStreamand 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.