Class NettyUtil


  • public final class NettyUtil
    extends Object
    Utility class for netty-related operations
    • Method Detail

      • getBestEventLoopGroup

        @NonNull
        public static io.netty.channel.EventLoopGroup getBestEventLoopGroup​(int nThreads)
        Returns the EventLoopGroup that fits best to the current environment. Under Linux the more performant EpollEventLoopGroup is returned.
        Returns:
        EventLoopGroup that fits best to the current environment
      • getBestDatagramChannel

        public static Class<? extends io.netty.channel.socket.DatagramChannel> getBestDatagramChannel()
        Returns the DatagramChannel that fits best to the current environment. Under Linux the more performant EpollDatagramChannel is returned.
        Returns:
        DatagramChannel that fits best to the current environment