epollInReady() — netty Function Reference
Architecture documentation for the epollInReady() function in EpollDatagramChannel.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 0ad4ff23_5654_f57a_1eda_1a36ffc34db3["epollInReady()"] 16c18e77_27a9_db0d_1655_3af5467ab836["EpollDatagramChannelUnsafe"] 0ad4ff23_5654_f57a_1eda_1a36ffc34db3 -->|defined in| 16c18e77_27a9_db0d_1655_3af5467ab836 daa0830e_c1a5_555e_b994_3e9c10904a12["isConnected()"] 0ad4ff23_5654_f57a_1eda_1a36ffc34db3 -->|calls| daa0830e_c1a5_555e_b994_3e9c10904a12 781125de_e972_9413_5a08_3062454df535["recvmsg()"] 0ad4ff23_5654_f57a_1eda_1a36ffc34db3 -->|calls| 781125de_e972_9413_5a08_3062454df535 a9b1c5fd_68a8_def9_939f_1fe28c28b12c["connectedRead()"] 0ad4ff23_5654_f57a_1eda_1a36ffc34db3 -->|calls| a9b1c5fd_68a8_def9_939f_1fe28c28b12c 7cf07df9_4be2_ed29_9353_cac4c09b8739["scatteringRead()"] 0ad4ff23_5654_f57a_1eda_1a36ffc34db3 -->|calls| 7cf07df9_4be2_ed29_9353_cac4c09b8739 style 0ad4ff23_5654_f57a_1eda_1a36ffc34db3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java lines 544–612
@Override
void epollInReady() {
assert eventLoop().inEventLoop();
EpollDatagramChannelConfig config = config();
if (shouldBreakEpollInReady(config)) {
clearEpollIn0();
return;
}
final EpollRecvByteAllocatorHandle allocHandle = recvBufAllocHandle();
final ChannelPipeline pipeline = pipeline();
final ByteBufAllocator allocator = config.getAllocator();
allocHandle.reset(config);
Throwable exception = null;
try {
try {
boolean connected = isConnected();
do {
final boolean read;
int datagramSize = config().getMaxDatagramPayloadSize();
ByteBuf byteBuf = allocHandle.allocate(allocator);
// Only try to use recvmmsg if its really supported by the running system.
int numDatagram = Native.IS_SUPPORTING_RECVMMSG ?
datagramSize == 0 ? 1 : byteBuf.writableBytes() / datagramSize :
0;
try {
if (numDatagram <= 1) {
if (!connected || config.isUdpGro()) {
read = recvmsg(allocHandle, cleanDatagramPacketArray(), byteBuf);
} else {
read = connectedRead(allocHandle, byteBuf, datagramSize);
}
} else {
// Try to use scattering reads via recvmmsg(...) syscall.
read = scatteringRead(allocHandle, cleanDatagramPacketArray(),
byteBuf, datagramSize, numDatagram);
}
} catch (NativeIoException e) {
if (connected) {
throw translateForConnected(e);
}
throw e;
}
if (read) {
readPending = false;
} else {
break;
}
// We use the TRUE_SUPPLIER as it is also ok to read less then what we did try to read (as long
// as we read anything).
} while (allocHandle.continueReading(UncheckedBooleanSupplier.TRUE_SUPPLIER));
} catch (Throwable t) {
exception = t;
}
allocHandle.readComplete();
pipeline.fireChannelReadComplete();
if (exception != null) {
pipeline.fireExceptionCaught(exception);
}
} finally {
if (shouldStopReading(config)) {
clearEpollIn();
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does epollInReady() do?
epollInReady() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java.
Where is epollInReady() defined?
epollInReady() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java at line 544.
What does epollInReady() call?
epollInReady() calls 4 function(s): connectedRead, isConnected, recvmsg, scatteringRead.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free