doWrite() — netty Function Reference
Architecture documentation for the doWrite() function in AbstractKQueueStreamChannel.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD c37b6b64_00c0_2805_a64f_69d2f1283642["doWrite()"] d154050d_32bb_fde7_fa64_5c82411c48d6["AbstractKQueueStreamChannel"] c37b6b64_00c0_2805_a64f_69d2f1283642 -->|defined in| d154050d_32bb_fde7_fa64_5c82411c48d6 5e722992_098a_76fd_00b1_7e52bc6b14a4["doWriteMultiple()"] c37b6b64_00c0_2805_a64f_69d2f1283642 -->|calls| 5e722992_098a_76fd_00b1_7e52bc6b14a4 bd3a0c39_614b_daae_7204_b68d27ee6ab0["doWriteSingle()"] c37b6b64_00c0_2805_a64f_69d2f1283642 -->|calls| bd3a0c39_614b_daae_7204_b68d27ee6ab0 style c37b6b64_00c0_2805_a64f_69d2f1283642 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java lines 268–304
@Override
protected void doWrite(ChannelOutboundBuffer in) throws Exception {
int writeSpinCount = config().getWriteSpinCount();
do {
final int msgCount = in.size();
// Do gathering write if the outbound buffer entries start with more than one ByteBuf.
if (msgCount > 1 && in.current() instanceof ByteBuf) {
writeSpinCount -= doWriteMultiple(in);
} else if (msgCount == 0) {
// Wrote all messages.
writeFilter(false);
// Return here so we don't set the WRITE flag.
return;
} else { // msgCount == 1
writeSpinCount -= doWriteSingle(in);
}
// We do not break the loop here even if the outbound buffer was flushed completely,
// because a user might have triggered another write and flush when we notify his or her
// listeners.
} while (writeSpinCount > 0);
if (writeSpinCount == 0) {
// It is possible that we have set the write filter, woken up by KQUEUE because the socket is writable, and
// then use our write quantum. In this case we no longer want to set the write filter because the socket is
// still writable (as far as we know). We will find out next time we attempt to write if the socket is
// writable and set the write filter if necessary.
writeFilter(false);
// We used our writeSpin quantum, and should try to write again later.
eventLoop().execute(flushTask);
} else {
// Underlying descriptor can not accept all data currently, so set the WRITE flag to be woken up
// when it can accept more data.
writeFilter(true);
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does doWrite() do?
doWrite() is a function in the netty codebase, defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java.
Where is doWrite() defined?
doWrite() is defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java at line 268.
What does doWrite() call?
doWrite() calls 2 function(s): doWriteMultiple, doWriteSingle.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free