mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
* Add NIOAsyncChannel based connect methods to ClientBootstrap # Motivation In my previous PR, I added new `bind` methods to `ServerBootstrap` that vend `NIOAsyncChannel` or support an async protocol negotiation. This PR focuses on adding new `connect` methods to `ClientBootstrap` which offer the same functionality. # Modification This PR adds new `connect` methods that either vend a `NIOAsyncChannel` or an asynchronous protocol negotiation result. To make this work I had to change the `HappyEyeballs` resolver so that it can return a generic value on resolving. Lastly, I adapted the bootstrap tests to use the new `ClientBootstrap` capabilities which now demonstrate a client/server protocol negotiation dance. # Result We can now bootstrap TCP clients with `NIOAsyncChannel`s * Reduce code duplication * Create a new set of APIs to tunnel an arbitrary Sendable payload through the inits * Pass EL to closure * Fix documentation