Channel

public protocol Channel : AnyObject, ChannelOutboundInvoker

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.

Note

All operations on Channel are thread-safe.

In 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 EventLoopPromises 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.