writePendingBytes() — netty Function Reference
Architecture documentation for the writePendingBytes() function in DefaultHttp2RemoteFlowController.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad["writePendingBytes()"] 095a31fa_5eda_a3b5_9421_f6a5ba1d388c["WritabilityMonitor"] 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad -->|defined in| 095a31fa_5eda_a3b5_9421_f6a5ba1d388c a2c60377_22f9_834d_ce35_78ca17897689["writePendingBytes()"] a2c60377_22f9_834d_ce35_78ca17897689 -->|calls| 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad 4726301f_0167_8ad7_ccda_f3c46efe04f9["initialWindowSize()"] 4726301f_0167_8ad7_ccda_f3c46efe04f9 -->|calls| 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad a2c60377_22f9_834d_ce35_78ca17897689["writePendingBytes()"] 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad -->|calls| a2c60377_22f9_834d_ce35_78ca17897689 320e1960_32da_24ad_1d4d_a86c2f06104e["writableBytes()"] 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad -->|calls| 320e1960_32da_24ad_1d4d_a86c2f06104e 1cd8a8f6_03dd_3223_8eab_30f7f01b261c["isChannelWritable0()"] 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad -->|calls| 1cd8a8f6_03dd_3223_8eab_30f7f01b261c style 1b91d5a0_59ed_e138_1c7d_a8c48586e1ad fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowController.java lines 610–634
final void writePendingBytes() throws Http2Exception {
// Reentry is not permitted during the byte distribution process. It may lead to undesirable distribution of
// bytes and even infinite loops. We protect against reentry and make sure each call has an opportunity to
// cause a distribution to occur. This may be useful for example if the channel's writability changes from
// Writable -> Not Writable (because we are writing) -> Writable (because the user flushed to make more room
// in the channel outbound buffer).
if (inWritePendingBytes) {
return;
}
inWritePendingBytes = true;
try {
int bytesToWrite = writableBytes();
// Make sure we always write at least once, regardless if we have bytesToWrite or not.
// This ensures that zero-length frames will always be written.
for (;;) {
if (!streamByteDistributor.distribute(bytesToWrite, this) ||
(bytesToWrite = writableBytes()) <= 0 ||
!isChannelWritable0()) {
break;
}
}
} finally {
inWritePendingBytes = false;
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does writePendingBytes() do?
writePendingBytes() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowController.java.
Where is writePendingBytes() defined?
writePendingBytes() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowController.java at line 610.
What does writePendingBytes() call?
writePendingBytes() calls 3 function(s): isChannelWritable0, writableBytes, writePendingBytes.
What calls writePendingBytes()?
writePendingBytes() is called by 2 function(s): initialWindowSize, writePendingBytes.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free