Package io.netty.channel.epoll
Class Native
- java.lang.Object
-
- io.netty.channel.epoll.Native
-
public final class Native extends java.lang.Object
Native helper methodsInternal usage only!
Static members which call JNI methods must be defined in
NativeStaticallyReferencedJniMethods
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
EPOLLERR
static int
EPOLLET
static int
EPOLLIN
static int
EPOLLOUT
static int
EPOLLRDHUP
(package private) static java.net.InetAddress
INET_ANY
(package private) static java.net.InetAddress
INET6_ANY
(package private) static boolean
IS_SUPPORTING_RECVMMSG
static boolean
IS_SUPPORTING_SENDMMSG
static boolean
IS_SUPPORTING_TCP_FASTOPEN
Deprecated.(package private) static boolean
IS_SUPPORTING_TCP_FASTOPEN_CLIENT
tcp_fastopen client mode enabled state.(package private) static boolean
IS_SUPPORTING_TCP_FASTOPEN_SERVER
tcp_fastopen server mode enabled state.(package private) static boolean
IS_SUPPORTING_UDP_SEGMENT
static java.lang.String
KERNEL_VERSION
private static InternalLogger
logger
private static int
TCP_FASTOPEN_MODE
static int
TCP_MD5SIG_MAXKEYLEN
private static int
TFO_ENABLED_CLIENT_MASK
private static int
TFO_ENABLED_SERVER_MASK
-
Constructor Summary
Constructors Modifier Constructor Description private
Native()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static int
epollBusyWait(FileDescriptor epollFd, EpollEventArray events)
Non-blocking variant ofepollWait(FileDescriptor, EpollEventArray, FileDescriptor, int, int)
that will also hint to processor we are in a busy-wait loop.private static int
epollBusyWait0(int efd, long address, int len)
private static int
epollCreate()
static void
epollCtlAdd(int efd, int fd, int flags)
private static int
epollCtlAdd0(int efd, int fd, int flags)
static void
epollCtlDel(int efd, int fd)
private static int
epollCtlDel0(int efd, int fd)
static void
epollCtlMod(int efd, int fd, int flags)
private static int
epollCtlMod0(int efd, int fd, int flags)
(package private) static int
epollReady(long result)
(package private) static boolean
epollTimerWasUsed(long result)
private static int
epollWait(int efd, long address, int len, int timeout)
(package private) static int
epollWait(FileDescriptor epollFd, EpollEventArray events, boolean immediatePoll)
(package private) static int
epollWait(FileDescriptor epollFd, EpollEventArray events, int timeoutMillis)
This uses epoll's own timeout and does not reset/re-arm any timerfdstatic int
epollWait(FileDescriptor epollFd, EpollEventArray events, FileDescriptor timerFd, int timeoutSec, int timeoutNs)
Deprecated.this method is no longer supported.(package private) static long
epollWait(FileDescriptor epollFd, EpollEventArray events, FileDescriptor timerFd, int timeoutSec, int timeoutNs, long millisThreshold)
private static long
epollWait0(int efd, long address, int len, int timerFd, int timeoutSec, int timeoutNs, long millisThreshold)
private static int
eventFd()
static void
eventFdRead(int fd)
static void
eventFdWrite(int fd, long value)
private static boolean
isSupportingUdpSegment()
private static void
loadNativeLibrary()
static FileDescriptor
newEpollCreate()
static FileDescriptor
newEventFd()
static FileDescriptor
newTimerFd()
static int
offsetofEpollData()
(package private) static int
recvmmsg(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
private static int
recvmmsg0(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
(package private) static int
recvmsg(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket packet)
private static int
recvmsg0(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket msg)
private static int
registerUnix()
(package private) static int
sendmmsg(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
static int
sendmmsg(int fd, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
Deprecated.private static int
sendmmsg0(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
static int
sizeofEpollEvent()
static int
splice(int fd, long offIn, int fdOut, long offOut, long len)
private static int
splice0(int fd, long offIn, int fdOut, long offOut, long len)
private static int
timerFd()
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
-
INET6_ANY
static final java.net.InetAddress INET6_ANY
-
INET_ANY
static final java.net.InetAddress INET_ANY
-
EPOLLIN
public static final int EPOLLIN
-
EPOLLOUT
public static final int EPOLLOUT
-
EPOLLRDHUP
public static final int EPOLLRDHUP
-
EPOLLET
public static final int EPOLLET
-
EPOLLERR
public static final int EPOLLERR
-
IS_SUPPORTING_SENDMMSG
public static final boolean IS_SUPPORTING_SENDMMSG
-
IS_SUPPORTING_RECVMMSG
static final boolean IS_SUPPORTING_RECVMMSG
-
IS_SUPPORTING_UDP_SEGMENT
static final boolean IS_SUPPORTING_UDP_SEGMENT
-
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.
-
IS_SUPPORTING_TCP_FASTOPEN
@Deprecated public static final boolean IS_SUPPORTING_TCP_FASTOPEN
Deprecated.
-
TCP_MD5SIG_MAXKEYLEN
public static final int TCP_MD5SIG_MAXKEYLEN
-
KERNEL_VERSION
public static final java.lang.String KERNEL_VERSION
-
-
Method Detail
-
registerUnix
private static int registerUnix()
-
newEventFd
public static FileDescriptor newEventFd()
-
newTimerFd
public static FileDescriptor newTimerFd()
-
isSupportingUdpSegment
private static boolean isSupportingUdpSegment()
-
eventFd
private static int eventFd()
-
timerFd
private static int timerFd()
-
eventFdWrite
public static void eventFdWrite(int fd, long value)
-
eventFdRead
public static void eventFdRead(int fd)
-
newEpollCreate
public static FileDescriptor newEpollCreate()
-
epollCreate
private static int epollCreate()
-
epollWait
@Deprecated public static int epollWait(FileDescriptor epollFd, EpollEventArray events, FileDescriptor timerFd, int timeoutSec, int timeoutNs) throws java.io.IOException
Deprecated.this method is no longer supported. This functionality is internal to this package.- Throws:
java.io.IOException
-
epollWait
static long epollWait(FileDescriptor epollFd, EpollEventArray events, FileDescriptor timerFd, int timeoutSec, int timeoutNs, long millisThreshold) throws java.io.IOException
- Throws:
java.io.IOException
-
epollReady
static int epollReady(long result)
-
epollTimerWasUsed
static boolean epollTimerWasUsed(long result)
-
epollWait
static int epollWait(FileDescriptor epollFd, EpollEventArray events, boolean immediatePoll) throws java.io.IOException
- Throws:
java.io.IOException
-
epollWait
static int epollWait(FileDescriptor epollFd, EpollEventArray events, int timeoutMillis) throws java.io.IOException
This uses epoll's own timeout and does not reset/re-arm any timerfd- Throws:
java.io.IOException
-
epollBusyWait
public static int epollBusyWait(FileDescriptor epollFd, EpollEventArray events) throws java.io.IOException
Non-blocking variant ofepollWait(FileDescriptor, EpollEventArray, FileDescriptor, int, int)
that will also hint to processor we are in a busy-wait loop.- Throws:
java.io.IOException
-
epollWait0
private static long epollWait0(int efd, long address, int len, int timerFd, int timeoutSec, int timeoutNs, long millisThreshold)
-
epollWait
private static int epollWait(int efd, long address, int len, int timeout)
-
epollBusyWait0
private static int epollBusyWait0(int efd, long address, int len)
-
epollCtlAdd
public static void epollCtlAdd(int efd, int fd, int flags) throws java.io.IOException
- Throws:
java.io.IOException
-
epollCtlAdd0
private static int epollCtlAdd0(int efd, int fd, int flags)
-
epollCtlMod
public static void epollCtlMod(int efd, int fd, int flags) throws java.io.IOException
- Throws:
java.io.IOException
-
epollCtlMod0
private static int epollCtlMod0(int efd, int fd, int flags)
-
epollCtlDel
public static void epollCtlDel(int efd, int fd) throws java.io.IOException
- Throws:
java.io.IOException
-
epollCtlDel0
private static int epollCtlDel0(int efd, int fd)
-
splice
public static int splice(int fd, long offIn, int fdOut, long offOut, long len) throws java.io.IOException
- Throws:
java.io.IOException
-
splice0
private static int splice0(int fd, long offIn, int fdOut, long offOut, long len)
-
sendmmsg
@Deprecated public static int sendmmsg(int fd, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendmmsg
static int sendmmsg(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
sendmmsg0
private static int sendmmsg0(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
-
recvmmsg
static int recvmmsg(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
recvmmsg0
private static int recvmmsg0(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket[] msgs, int offset, int len)
-
recvmsg
static int recvmsg(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket packet) throws java.io.IOException
- Throws:
java.io.IOException
-
recvmsg0
private static int recvmsg0(int fd, boolean ipv6, NativeDatagramPacketArray.NativeDatagramPacket msg)
-
sizeofEpollEvent
public static int sizeofEpollEvent()
-
offsetofEpollData
public static int offsetofEpollData()
-
loadNativeLibrary
private static void loadNativeLibrary()
-
-