Channel
A Channel
is easiest thought of as a network socket. But it can be anything that is capable of I/O operations such as read, write, connect, and bind.
protocol Channel : AnyObject, ChannelOutboundInvoker, _NIOPreconcurrencySendable
Browse conforming typesIn SwiftNIO, all I/O operations are asynchronous and hence all operations on Channel
are asynchronous too. This means that all I/O operations will return immediately, usually before the work has been completed. The EventLoopPromise
s passed to or returned by the operations are used to retrieve the result of an operation after it has completed.
A Channel
owns its ChannelPipeline
which handles all I/O events and requests associated with the Channel
.