Required Instance Methodswift-nio 2.72.0NIOCore
write(context:data:promise:)
Called to request a write operation. The write operation will write the messages through the ChannelPipeline
. Those are then ready to be flushed to the actual Channel
when Channel.flush
or ChannelHandlerContext.flush
is called.
func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
Parameters
This should call context.write
to forward the operation to the next _ChannelOutboundHandler
in the ChannelPipeline
or complete the EventLoopPromise
to let the caller know that the operation completed.
Other requirements
Instance members
func bind(context: ChannelHandlerContext, to: SocketAddress, promise: EventLoopPromise<Void>?
) Called to request that the
Channel
bind to a specificSocketAddress
.func close(context: ChannelHandlerContext, mode: CloseMode, promise: EventLoopPromise<Void>?
) Called to request that the
Channel
close itself down.func connect(context: ChannelHandlerContext, to: SocketAddress, promise: EventLoopPromise<Void>?
) Called to request that the
Channel
connect to a givenSocketAddress
.func flush(context: ChannelHandlerContext
) Called to request that the
Channel
flush all pending writes. The flush operation will try to flush out all previous written messages that are pending.func read(context: ChannelHandlerContext
) Called to request that the
Channel
perform a read when data is ready. The read operation will signal that we are ready to read more data.func register(context: ChannelHandlerContext, promise: EventLoopPromise<Void>?
) Called to request that the
Channel
register itself for I/O events with itsEventLoop
. This should callcontext.register
to forward the operation to the next_ChannelOutboundHandler
in theChannelPipeline
or complete theEventLoopPromise
to let the caller know that the operation completed.func triggerUserOutboundEvent(context: ChannelHandlerContext, event: Any, promise: EventLoopPromise<Void>?
) Called when an user outbound event is triggered.