swift-nio/Sources/NIOPosix
Franz Busch 46c0538253
Add NIOAsyncChannel based connect methods to ClientBootstrap (#2437)
* 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
2023-06-06 03:36:53 -07:00
..
BSDSocketAPICommon.swift Add `RawSocketBootstrap` (#2320) 2022-12-01 15:35:04 +01:00
BSDSocketAPIPosix.swift Add support for UDP_GRO (#2385) 2023-03-06 07:12:09 -08:00
BSDSocketAPIWindows.swift Add support for UDP_GRO (#2385) 2023-03-06 07:12:09 -08:00
BaseSocket.swift Fix an upcoming compiler warning on implicit raw pointer casts. (#2377) 2023-02-28 00:23:36 -08:00
BaseSocketChannel+SocketOptionProvider.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
BaseSocketChannel.swift Don't have channels stop reading on errors they tolerate. (#2408) 2023-04-20 11:09:02 +01:00
BaseStreamSocketChannel.swift Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
Bootstrap.swift Add NIOAsyncChannel based connect methods to ClientBootstrap (#2437) 2023-06-06 03:36:53 -07:00
ControlMessage.swift Pooled control message storage. (#2422) 2023-05-31 06:06:23 -07:00
DatagramVectorReadManager.swift NIOPosix: adjust precondition for Windows (#2183) 2022-06-10 09:14:27 -07:00
FileDescriptor.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
GetaddrinfoResolver.swift NIOPosix: use internal enumeration for GAI resolver (#2177) 2022-06-09 08:21:24 +01:00
HappyEyeballs.swift Add NIOAsyncChannel based connect methods to ClientBootstrap (#2437) 2023-06-06 03:36:53 -07:00
IO.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
IntegerBitPacking.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
IntegerTypes.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
Linux.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
LinuxCPUSet.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
LinuxUring.swift Enable io_uring builds with newer liburing (#2006) 2021-12-09 09:19:12 +00:00
MultiThreadedEventLoopGroup.swift Don't retain a task when all we want is a time (#2373) 2023-02-20 07:27:58 -08:00
NIOThreadPool.swift mark syncShutdownGracefully noasync (#2381) 2023-03-02 06:20:23 -08:00
NonBlockingFileIO.swift cap read+pread POSIX read sizes at Int32.max (#2323) 2022-11-28 13:19:12 +00:00
PendingDatagramWritesManager.swift Pooled control message storage. (#2422) 2023-05-31 06:06:23 -07:00
PendingWritesManager.swift Make PooledBuffer safer. (#2363) 2023-02-08 07:59:17 +00:00
PipeChannel.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
PipePair.swift Add initial support for connected datagram sockets (#2084) 2022-05-31 13:21:41 +01:00
PointerHelpers.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
Pool.swift Pooled control message storage. (#2422) 2023-05-31 06:06:23 -07:00
PooledRecvBufferAllocator.swift Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
RawSocketBootstrap.swift Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
Resolver.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
Selectable.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
SelectableChannel.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
SelectableEventLoop.swift Pooled control message storage. (#2422) 2023-05-31 06:06:23 -07:00
SelectorEpoll.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
SelectorGeneric.swift rename class Lock to struct NIOLock (#2266) 2022-09-21 07:36:42 -07:00
SelectorKqueue.swift Add safer abstraction for kqueue filter set. (#1951) 2021-09-06 14:59:30 +01:00
SelectorUring.swift Fixed some typos (#2051) 2022-02-22 01:37:47 -08:00
ServerSocket.swift Avoid double-closing on fcntl failures (#2409) 2023-04-20 12:40:39 +01:00
Socket.swift Add support for UDP_GRO (#2385) 2023-03-06 07:12:09 -08:00
SocketChannel.swift Pooled control message storage. (#2422) 2023-05-31 06:06:23 -07:00
SocketProtocols.swift Avoid double-closing on fcntl failures (#2409) 2023-04-20 12:40:39 +01:00
System.swift Add `NIOBSDSocket.ProtocolSubtype` (#2317) 2022-11-22 06:01:52 -08:00
Thread.swift Remove `#if compiler(>=5.5)` (#2292) 2022-10-13 07:17:46 -07:00
ThreadPosix.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
ThreadWindows.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
Utilities.swift Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00