Fix Native EPOLL Build Failure Motiviation: If sendmmsg is already defined then the native epoll module failed to build because of conflicting definitions. The mmsghdr type was also redefined on systems that already supported this structure.
Modifications: Provide a way so that systems which already define sendmmsg and mmsghdr can build Provide a way so that systems which don't define sendmmsg and mmsghdr can build
Result: The native EPOLL module can build in more environments
Add support for sendmmsg(...) and so allow to write multiple DatagramPackets with one syscall. Related to [#2719] Motivation:
On linux with glibc >= 2.14 it is possible to send multiple DatagramPackets with one syscall. This can be a huge performance win and so we should support it in our native transport.
- Add support for sendmmsg by reuse IovArray - Factor out ThreadLocal support of IovArray to IovArrayThreadLocal for better separation as we use IovArray also without ThreadLocal in NativeDatagramPacketArray now - Introduce NativeDatagramPacketArray which is used for sendmmsg(...) - Implement sendmmsg(...) via jni - Expand DatagramUnicastTest to test also sendmmsg(...)
Netty now automatically use sendmmsg(...) if it is supported and we have more then 1 DatagramPacket in the ChannelOutboundBuffer and flush() is called.