Required Instance Methodswift-nio 2.72.0NIOCore
flush(context:)
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 flush(context: ChannelHandlerContext)
Parameters
- context
The
ChannelHandlerContext
which thisChannelHandler
belongs to.
This should call context.flush
to forward the operation to the next _ChannelOutboundHandler
in the ChannelPipeline
or just discard it if the flush should be suppressed.
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 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.
func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?
) 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 actualChannel
whenChannel.flush
orChannelHandlerContext.flush
is called.