Structureswift-nio 2.72.0NIOCore
DatagramSegmentSize
DatagramSegmentSize
controls the UDP_SEGMENT
socket option (sometimes reffered to as ‘GSO’) which allows for large writes to be sent via sendmsg
and sendmmsg
and segmented into separate datagrams by the kernel (or in some cases, the NIC). The size of segments the large write is split into is controlled by the value of this option (note that writes do not need to be a multiple of this option).
struct DatagramSegmentSize
This option is currently only supported on Linux (4.18 and newer). Support can be checked using supportsUDPSegmentationOffload
.
Setting this option to zero disables segmentation offload.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (16) members.
Types
struct AllocatorOption
AllocatorOption
allows to specify theByteBufferAllocator
to use.struct AllowRemoteHalfClosureOption
AllowRemoteHalfClosureOption
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.struct AutoReadOption
AutoReadOption
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.struct BacklogOption
BacklogOption
allows users to configure thebacklog
value as specified inman 2 listen
. This is only useful forServerSocketChannel
s.struct ConnectTimeoutOption
ConnectTimeoutOption
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.enum ConvenienceOptionValue<ValueType>
Has an option been set? Option has a value of generic type ValueType.
struct DatagramReceiveOffload
DatagramReceiveOffload
sets theUDP_GRO
socket option which allows for datagrams to be accumulated by the kernel (or in some cases, the NIC) and reduces traversals in the kernel’s networking layer.struct DatagramVectorReadMessageCountOption
DatagramVectorReadMessageCountOption
allows users to configure the number of messages to attempt to read in a single syscall on a datagramChannel
.struct ExplicitCongestionNotificationsOption
When set to true IP level ECN information will be reported through
AddressedEnvelope.Metadata
struct MaxMessagesPerReadOption
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.struct ReceivePacketInfo
When set to true IP level Packet Info information will be reported through
AddressedEnvelope.Metadata
for UDP packets.struct RecvAllocatorOption
RecvAllocatorOption
allows users to specify theRecvByteBufferAllocator
to use.struct SocketOption
SocketOption
allows users to specify configuration settings that are directly applied to the underlying socket file descriptor.struct WriteBufferWaterMark
The watermark used to detect when
Channel.isWritable
returnstrue
orfalse
.struct WriteBufferWaterMarkOption
WriteBufferWaterMarkOption
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
.struct WriteSpinOption
WriteSpinOption
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.
Citizens in NIOCore
Conformances
protocol ChannelOption
A configuration option that can be set on a
Channel
to configure different behaviour.protocol Equatable
A type that can be compared for value equality.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Show implementation details (1)
Hide implementation details
Typealiases
Type members
Type features
static var datagramSegmentSize: Self
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.