Class Native


  • final class Native
    extends java.lang.Object
    • Field Detail

      • logger

        private static final io.netty.util.internal.logging.InternalLogger logger
      • DEFAULT_RING_SIZE

        static final int DEFAULT_RING_SIZE
      • DEFAULT_IOSQE_ASYNC_THRESHOLD

        static final int DEFAULT_IOSQE_ASYNC_THRESHOLD
        When there are more FDs (= connections) than this setting, the FDs will be marked as IOSQE_ASYNC, under the expectation that read/write ops on the FDs will usually block. If this expectation is correct, IOSQE_ASYNC can reduce CPU usage, but if the expectation is incorrect, it may add additional, unnecessary latency.

        Default is to never use IOSQE_ASYNC.

      • SOCK_NONBLOCK

        static final int SOCK_NONBLOCK
      • SOCK_CLOEXEC

        static final int SOCK_CLOEXEC
      • AF_INET

        static final short AF_INET
      • AF_INET6

        static final short AF_INET6
      • SIZEOF_SOCKADDR_STORAGE

        static final int SIZEOF_SOCKADDR_STORAGE
      • SIZEOF_SOCKADDR_IN

        static final int SIZEOF_SOCKADDR_IN
      • SIZEOF_SOCKADDR_IN6

        static final int SIZEOF_SOCKADDR_IN6
      • SOCKADDR_IN_OFFSETOF_SIN_FAMILY

        static final int SOCKADDR_IN_OFFSETOF_SIN_FAMILY
      • SOCKADDR_IN_OFFSETOF_SIN_PORT

        static final int SOCKADDR_IN_OFFSETOF_SIN_PORT
      • SOCKADDR_IN_OFFSETOF_SIN_ADDR

        static final int SOCKADDR_IN_OFFSETOF_SIN_ADDR
      • IN_ADDRESS_OFFSETOF_S_ADDR

        static final int IN_ADDRESS_OFFSETOF_S_ADDR
      • SOCKADDR_IN6_OFFSETOF_SIN6_FAMILY

        static final int SOCKADDR_IN6_OFFSETOF_SIN6_FAMILY
      • SOCKADDR_IN6_OFFSETOF_SIN6_PORT

        static final int SOCKADDR_IN6_OFFSETOF_SIN6_PORT
      • SOCKADDR_IN6_OFFSETOF_SIN6_FLOWINFO

        static final int SOCKADDR_IN6_OFFSETOF_SIN6_FLOWINFO
      • SOCKADDR_IN6_OFFSETOF_SIN6_ADDR

        static final int SOCKADDR_IN6_OFFSETOF_SIN6_ADDR
      • SOCKADDR_IN6_OFFSETOF_SIN6_SCOPE_ID

        static final int SOCKADDR_IN6_OFFSETOF_SIN6_SCOPE_ID
      • IN6_ADDRESS_OFFSETOF_S6_ADDR

        static final int IN6_ADDRESS_OFFSETOF_S6_ADDR
      • SIZEOF_SIZE_T

        static final int SIZEOF_SIZE_T
      • SIZEOF_IOVEC

        static final int SIZEOF_IOVEC
      • CMSG_SPACE

        static final int CMSG_SPACE
      • CMSG_LEN

        static final int CMSG_LEN
      • CMSG_OFFSETOF_CMSG_LEN

        static final int CMSG_OFFSETOF_CMSG_LEN
      • CMSG_OFFSETOF_CMSG_LEVEL

        static final int CMSG_OFFSETOF_CMSG_LEVEL
      • CMSG_OFFSETOF_CMSG_TYPE

        static final int CMSG_OFFSETOF_CMSG_TYPE
      • IOVEC_OFFSETOF_IOV_BASE

        static final int IOVEC_OFFSETOF_IOV_BASE
      • IOVEC_OFFSETOF_IOV_LEN

        static final int IOVEC_OFFSETOF_IOV_LEN
      • SIZEOF_MSGHDR

        static final int SIZEOF_MSGHDR
      • MSGHDR_OFFSETOF_MSG_NAME

        static final int MSGHDR_OFFSETOF_MSG_NAME
      • MSGHDR_OFFSETOF_MSG_NAMELEN

        static final int MSGHDR_OFFSETOF_MSG_NAMELEN
      • MSGHDR_OFFSETOF_MSG_IOV

        static final int MSGHDR_OFFSETOF_MSG_IOV
      • MSGHDR_OFFSETOF_MSG_IOVLEN

        static final int MSGHDR_OFFSETOF_MSG_IOVLEN
      • MSGHDR_OFFSETOF_MSG_CONTROL

        static final int MSGHDR_OFFSETOF_MSG_CONTROL
      • MSGHDR_OFFSETOF_MSG_CONTROLLEN

        static final int MSGHDR_OFFSETOF_MSG_CONTROLLEN
      • MSGHDR_OFFSETOF_MSG_FLAGS

        static final int MSGHDR_OFFSETOF_MSG_FLAGS
      • POLLIN

        static final int POLLIN
      • POLLOUT

        static final int POLLOUT
      • POLLRDHUP

        static final int POLLRDHUP
      • ERRNO_ECANCELED_NEGATIVE

        static final int ERRNO_ECANCELED_NEGATIVE
      • ERRNO_ETIME_NEGATIVE

        static final int ERRNO_ETIME_NEGATIVE
      • IORING_OP_POLL_ADD

        static final byte IORING_OP_POLL_ADD
      • IORING_OP_TIMEOUT

        static final byte IORING_OP_TIMEOUT
      • IORING_OP_TIMEOUT_REMOVE

        static final byte IORING_OP_TIMEOUT_REMOVE
      • IORING_OP_ACCEPT

        static final byte IORING_OP_ACCEPT
      • IORING_OP_READ

        static final byte IORING_OP_READ
      • IORING_OP_WRITE

        static final byte IORING_OP_WRITE
      • IORING_OP_RECV

        static final byte IORING_OP_RECV
      • IORING_OP_SEND

        static final byte IORING_OP_SEND
      • IORING_OP_POLL_REMOVE

        static final byte IORING_OP_POLL_REMOVE
      • IORING_OP_CONNECT

        static final byte IORING_OP_CONNECT
      • IORING_OP_CLOSE

        static final byte IORING_OP_CLOSE
      • IORING_OP_WRITEV

        static final byte IORING_OP_WRITEV
      • IORING_OP_SENDMSG

        static final byte IORING_OP_SENDMSG
      • IORING_OP_RECVMSG

        static final byte IORING_OP_RECVMSG
      • IORING_ENTER_GETEVENTS

        static final int IORING_ENTER_GETEVENTS
      • IOSQE_ASYNC

        static final int IOSQE_ASYNC
      • MSG_DONTWAIT

        static final int MSG_DONTWAIT
      • MSG_FASTOPEN

        static final int MSG_FASTOPEN
      • SOL_UDP

        static final int SOL_UDP
      • UDP_SEGMENT

        static final int UDP_SEGMENT
      • REQUIRED_IORING_OPS

        private static final int[] REQUIRED_IORING_OPS
      • TFO_ENABLED_CLIENT_MASK

        private static final int TFO_ENABLED_CLIENT_MASK
        See Also:
        Constant Field Values
      • TFO_ENABLED_SERVER_MASK

        private static final int TFO_ENABLED_SERVER_MASK
        See Also:
        Constant Field Values
      • TCP_FASTOPEN_MODE

        private static final int TCP_FASTOPEN_MODE
      • IS_SUPPORTING_TCP_FASTOPEN_CLIENT

        static final boolean IS_SUPPORTING_TCP_FASTOPEN_CLIENT
        tcp_fastopen client mode enabled state.
      • IS_SUPPORTING_TCP_FASTOPEN_SERVER

        static final boolean IS_SUPPORTING_TCP_FASTOPEN_SERVER
        tcp_fastopen server mode enabled state.
    • Constructor Detail

      • Native

        private Native()
    • Method Detail

      • createRingBuffer

        static RingBuffer createRingBuffer​(int ringSize)
      • createRingBuffer

        static RingBuffer createRingBuffer​(int ringSize,
                                           int iosqeAsyncThreshold)
      • createRingBuffer

        static RingBuffer createRingBuffer()
      • checkAllIOSupported

        static void checkAllIOSupported​(int ringFd)
      • checkKernelVersion

        static void checkKernelVersion​(java.lang.String kernelVersion)
      • checkKernelVersion0

        private static boolean checkKernelVersion0​(java.lang.String kernelVersion)
      • ioUringProbe

        private static boolean ioUringProbe​(int ringFd,
                                            int[] ios)
      • ioUringSetup

        private static long[][] ioUringSetup​(int entries)
      • ioUringEnter

        static int ioUringEnter​(int ringFd,
                                int toSubmit,
                                int minComplete,
                                int flags)
      • eventFdWrite

        static void eventFdWrite​(int fd,
                                 long value)
      • newBlockingEventFd

        static io.netty.channel.unix.FileDescriptor newBlockingEventFd()
      • ioUringExit

        static void ioUringExit​(long submissionQueueArrayAddress,
                                int submissionQueueRingEntries,
                                long submissionQueueRingAddress,
                                int submissionQueueRingSize,
                                long completionQueueRingAddress,
                                int completionQueueRingSize,
                                int ringFd)
      • blockingEventFd

        private static int blockingEventFd()
      • createFile

        static int createFile​(java.lang.String name)
      • registerUnix

        private static int registerUnix()
      • cmsghdrData

        static long cmsghdrData​(long hdrAddr)
      • kernelVersion

        static java.lang.String kernelVersion()
      • loadNativeLibrary

        private static void loadNativeLibrary()
      • tcpFastopenMode

        private static int tcpFastopenMode()