mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
Motivation: NIO has existing GRO support. This GRO support is applied at Channel scope, which makes it somewhat less than ideal, as it forces the datagram sizes to be accessed using socket options. In real applications this is less desirable than being able to do this on a per-superbuffer context. Linux supports this already by using recvmsg/recvmmsg control data. We just need to wire this up in NIO. We can re-use the existing metadata fields on AddressedEnvelope. Modifications: - Add a new ChannelOption to extra metadata - Reject setting this option on non-Linux devices. - On Linux, use this to load the control data. - Added new tests that validate the behaviour is correct. Result: Enable per-message GRO.