-
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
See moreman 4 tcp
.Declaration
Swift
public struct SocketOption : ChannelOption, Equatable
-
See moreAllocatorOption
allows to specify theByteBufferAllocator
to use.Declaration
Swift
public struct AllocatorOption : ChannelOption
-
See moreRecvAllocatorOption
allows users to specify theRecvByteBufferAllocator
to use.Declaration
Swift
public struct RecvAllocatorOption : ChannelOption
-
See moreAutoReadOption
allows users to configure if aChannel
should automatically callChannel.read
again once all data was read from the transport or if the user is responsible to callChannel.read
manually.Declaration
Swift
public struct AutoReadOption : ChannelOption
-
See moreWriteSpinOption
allows users to configure the number of repetitions of a only partially successful write call before considering theChannel
not writable. Setting this option to0
means that we only issue one write call and if that call does not write all the bytes, we consider theChannel
not writable.Declaration
Swift
public struct WriteSpinOption : ChannelOption
-
See moreMaxMessagesPerReadOption
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.Declaration
Swift
public struct MaxMessagesPerReadOption : ChannelOption
-
See moreBacklogOption
allows users to configure thebacklog
value as specified inman 2 listen
. This is only useful forServerSocketChannel
s.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 datagramChannel
.Some datagram
Channel
s 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 thisChannelOption
allows theChannel
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 byChannelOption.recvAllocator
) proportionally. For example, to receive 10 messages at a time, set the size of the buffers allocated by theRecvByteBufferAllocator
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 moreDeclaration
Swift
public struct DatagramVectorReadMessageCountOption : ChannelOption
-
When set to true IP level ECN information will be reported through
See moreAddressedEnvelope.Metadata
Declaration
Swift
public struct ExplicitCongestionNotificationsOption : ChannelOption
-
The watermark used to detect when
See moreChannel.isWritable
returnstrue
orfalse
.Declaration
Swift
public struct WriteBufferWaterMark
-
See moreWriteBufferWaterMarkOption
allows users to configure when aChannel
should be marked as writable or not. Once the amount of bytes queued in aChannel
s outbound buffer is larger thanWriteBufferWaterMark.high
the channel will be marked as non-writable and soChannel.isWritable
will returnfalse
. Once we were able to write some data out of the outbound buffer and the amount of bytes queued falls belowWriteBufferWaterMark.low
theChannel
will become writable again. Once this happensChannel.writable
will returntrue
again. These writability changes are also propagated through theChannelPipeline
and so can be intercepted viaChannelInboundHandler.channelWritabilityChanged
.Declaration
Swift
public struct WriteBufferWaterMarkOption : ChannelOption
-
See moreConnectTimeoutOption
allows users to configure theTimeAmount
after which a connect will fail if it was not established in the meantime. May benil
, in which case the connection attempt will never time out.Declaration
Swift
public struct ConnectTimeoutOption : ChannelOption
-
See moreAllowRemoteHalfClosureOption
allows users to configure whether theChannel
will close itself when its remote peer shuts down its send stream, or whether it will remain open. If set tofalse
(the default), theChannel
will be closed automatically if the remote peer shuts down its send stream. If set to true, theChannel
will not be closed: instead, aChannelEvent.inboundClosed
user event will be sent on theChannelPipeline
, and no more data will be received.Declaration
Swift
public struct AllowRemoteHalfClosureOption : ChannelOption
-
When set to true IP level Packet Info information will be reported through
See moreAddressedEnvelope.Metadata
for UDP packets.Declaration
Swift
public struct ReceivePacketInfo : ChannelOption
-
Has an option been set? Option has a value of generic type ValueType.
See moreDeclaration
Swift
public enum ConvenienceOptionValue<ValueType>