Types

public enum Types

Undocumented

  • SocketOption allows users to specify configuration settings that are directly applied to the underlying socket file descriptor.

    Valid options are typically found in the various man pages like man 4 tcp.

    See more

    Declaration

    Swift

    public struct SocketOption : ChannelOption, Equatable
  • AllocatorOption allows to specify the ByteBufferAllocator to use.

    See more

    Declaration

    Swift

    public struct AllocatorOption : ChannelOption
  • RecvAllocatorOption allows users to specify the RecvByteBufferAllocator to use.

    See more

    Declaration

    Swift

    public struct RecvAllocatorOption : ChannelOption
  • AutoReadOption allows users to configure if a Channel should automatically call Channel.read again once all data was read from the transport or if the user is responsible to call Channel.read manually.

    See more

    Declaration

    Swift

    public struct AutoReadOption : ChannelOption
  • WriteSpinOption allows users to configure the number of repetitions of a only partially successful write call before considering the Channel not writable. Setting this option to 0 means that we only issue one write call and if that call does not write all the bytes, we consider the Channel not writable.

    See more

    Declaration

    Swift

    public struct WriteSpinOption : ChannelOption
  • MaxMessagesPerReadOption allows users to configure the maximum number of read calls to the underlying transport are performed before wait again until there is more to read and be notified.

    See more

    Declaration

    Swift

    public struct MaxMessagesPerReadOption : ChannelOption
  • BacklogOption allows users to configure the backlog value as specified in man 2 listen. This is only useful for ServerSocketChannels.

    See more

    Declaration

    Swift

    public struct BacklogOption : ChannelOption
  • DatagramVectorReadMessageCountOption allows users to configure the number of messages to attempt to read in a single syscall on a datagram Channel.

    Some datagram Channels have extremely high datagram throughput. This can occur when the single datagram socket is encapsulating many logical connections (e.g. with QUIC) or when the datagram socket is simply serving an enormous number of consumers (e.g. with a public-facing DNS server). In this case the overhead of one syscall per datagram is profoundly limiting. Using this ChannelOption allows the Channel to read multiple datagrams at once.

    Note that simply increasing this number will not necessarily bring performance gains and may in fact cause data loss. Any increase to this should be matched by increasing the size of the buffers allocated by the Channel RecvByteBufferAllocator (as set by ChannelOption.recvAllocator) proportionally. For example, to receive 10 messages at a time, set the size of the buffers allocated by the RecvByteBufferAllocator to at least 10x the size of the maximum datagram size you wish to receive.

    Naturally, this option is only valid on datagram channels.

    This option only works on the following platforms:

    • Linux
    • FreeBSD
    • Android

    On all other platforms, setting it has no effect.

    Set this option to 0 to disable vector reads and to use serial reads instead.

    See more

    Declaration

    Swift

    public struct DatagramVectorReadMessageCountOption : ChannelOption
  • The watermark used to detect when Channel.isWritable returns true or false.

    See more

    Declaration

    Swift

    public struct WriteBufferWaterMark
  • WriteBufferWaterMarkOption allows users to configure when a Channel should be marked as writable or not. Once the amount of bytes queued in a Channels outbound buffer is larger than WriteBufferWaterMark.high the channel will be marked as non-writable and so Channel.isWritable will return false. Once we were able to write some data out of the outbound buffer and the amount of bytes queued falls below WriteBufferWaterMark.low the Channel will become writable again. Once this happens Channel.writable will return true again. These writability changes are also propagated through the ChannelPipeline and so can be intercepted via ChannelInboundHandler.channelWritabilityChanged.

    See more

    Declaration

    Swift

    public struct WriteBufferWaterMarkOption : ChannelOption
  • ConnectTimeoutOption allows users to configure the TimeAmount after which a connect will fail if it was not established in the meantime. May be nil, in which case the connection attempt will never time out.

    See more

    Declaration

    Swift

    public struct ConnectTimeoutOption : ChannelOption
  • AllowRemoteHalfClosureOption allows users to configure whether the Channel will close itself when its remote peer shuts down its send stream, or whether it will remain open. If set to false (the default), the Channel will be closed automatically if the remote peer shuts down its send stream. If set to true, the Channel will not be closed: instead, a ChannelEvent.inboundClosed user event will be sent on the ChannelPipeline, and no more data will be received.

    See more

    Declaration

    Swift

    public struct AllowRemoteHalfClosureOption : ChannelOption