ChannelOutboundInvoker

public protocol ChannelOutboundInvoker

Allows users to invoke an outbound operation related to a Channel that will flow through the ChannelPipeline until it will finally be executed by the the ChannelCore implementation.

  • register(file:line:) Extension method

    Register on an EventLoop and so have all its IO handled.

    Declaration

    Swift

    public func register(file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • bind(to:file:line:) Extension method

    Bind to a SocketAddress.

    Declaration

    Swift

    public func bind(to address: SocketAddress, file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Parameters

    to

    the SocketAddress to which we should bind the Channel.

    Return Value

    the future which will be notified once the operation completes.

  • connect(to:file:line:) Extension method

    Connect to a SocketAddress.

    Declaration

    Swift

    public func connect(to address: SocketAddress, file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Parameters

    to

    the SocketAddress to which we should connect the Channel.

    Return Value

    the future which will be notified once the operation completes.

  • write(_:file:line:) Extension method

    Write data to the remote peer.

    Be aware that to be sure that data is really written to the remote peer you need to call flush or use writeAndFlush. Calling write multiple times and then flush may allow the Channel to write multiple data objects to the remote peer with one syscall.

    Declaration

    Swift

    public func write(_ data: NIOAny, file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Parameters

    data

    the data to write

    Return Value

    the future which will be notified once the operation completes.

  • writeAndFlush(_:file:line:) Extension method

    Shortcut for calling write and flush.

    Declaration

    Swift

    public func writeAndFlush(_ data: NIOAny, file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Parameters

    data

    the data to write

    Return Value

    the future which will be notified once the write operation completes.

  • close(mode:file:line:) Extension method

    Close the Channel and so the connection if one exists.

    Declaration

    Swift

    public func close(mode: CloseMode = .all, file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Parameters

    mode

    the CloseMode that is used

    Return Value

    the future which will be notified once the operation completes.

  • Trigger a custom user outbound event which will flow through the ChannelPipeline.

    Declaration

    Swift

    public func triggerUserOutboundEvent(_ event: Any, file: StaticString = #file, line: UInt = #line) -> EventLoopFuture<Void>

    Parameters

    event

    the event itself.

    Return Value

    the future which will be notified once the operation completes.