writeHttp2StreamFrame() — netty Function Reference
Architecture documentation for the writeHttp2StreamFrame() function in AbstractHttp2StreamChannel.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 6ba5f11e_f430_02ca_f64c_f9a7338904bf["writeHttp2StreamFrame()"] 2656dcfe_5cdb_7c7d_bc25_312393fe2e05["Http2ChannelUnsafe"] 6ba5f11e_f430_02ca_f64c_f9a7338904bf -->|defined in| 2656dcfe_5cdb_7c7d_bc25_312393fe2e05 5ca6305e_9bed_80cc_f434_630ca5d3db99["write()"] 5ca6305e_9bed_80cc_f434_630ca5d3db99 -->|calls| 6ba5f11e_f430_02ca_f64c_f9a7338904bf f2cc69e0_59ea_5712_041e_9061085aa163["isEndOfStream()"] 6ba5f11e_f430_02ca_f64c_f9a7338904bf -->|calls| f2cc69e0_59ea_5712_041e_9061085aa163 f8ca9f49_0ec8_5096_d939_1871f523b5a4["firstWriteComplete()"] 6ba5f11e_f430_02ca_f64c_f9a7338904bf -->|calls| f8ca9f49_0ec8_5096_d939_1871f523b5a4 32a7a18d_d75e_ca41_7a57_2a5032b066d3["writeComplete()"] 6ba5f11e_f430_02ca_f64c_f9a7338904bf -->|calls| 32a7a18d_d75e_ca41_7a57_2a5032b066d3 c9703b2f_6638_8afe_037a_9077f1bed51c["incrementPendingOutboundBytes()"] 6ba5f11e_f430_02ca_f64c_f9a7338904bf -->|calls| c9703b2f_6638_8afe_037a_9077f1bed51c 7134f1fa_478b_d2e6_89ea_148d0d477e26["decrementPendingOutboundBytes()"] 6ba5f11e_f430_02ca_f64c_f9a7338904bf -->|calls| 7134f1fa_478b_d2e6_89ea_148d0d477e26 style 6ba5f11e_f430_02ca_f64c_f9a7338904bf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java lines 1074–1113
private void writeHttp2StreamFrame(Http2StreamFrame frame, final ChannelPromise promise) {
if (!firstFrameWritten && !isStreamIdValid(stream().id()) && !(frame instanceof Http2HeadersFrame)) {
ReferenceCountUtil.release(frame);
promise.setFailure(
new IllegalArgumentException("The first frame must be a headers frame. Was: "
+ frame.name()));
return;
}
final boolean firstWrite;
if (firstFrameWritten) {
firstWrite = false;
} else {
firstWrite = firstFrameWritten = true;
}
// Let's keep track of what we send as the stream state itself will only be updated once the frame
// was written which might cause problems if we try to close the channel in a write future.
sentEndOfStream |= isEndOfStream(frame);
ChannelFuture f = write0(parentContext(), frame);
if (f.isDone()) {
if (firstWrite) {
firstWriteComplete(f, promise);
} else {
writeComplete(f, promise);
}
} else {
final long bytes = FlowControlledFrameSizeEstimator.HANDLE_INSTANCE.size(frame);
incrementPendingOutboundBytes(bytes, false);
f.addListener(future -> {
if (firstWrite) {
firstWriteComplete(future, promise);
} else {
writeComplete(future, promise);
}
decrementPendingOutboundBytes(bytes, false);
});
writeDoneAndNoFlush = true;
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does writeHttp2StreamFrame() do?
writeHttp2StreamFrame() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java.
Where is writeHttp2StreamFrame() defined?
writeHttp2StreamFrame() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java at line 1074.
What does writeHttp2StreamFrame() call?
writeHttp2StreamFrame() calls 5 function(s): decrementPendingOutboundBytes, firstWriteComplete, incrementPendingOutboundBytes, isEndOfStream, writeComplete.
What calls writeHttp2StreamFrame()?
writeHttp2StreamFrame() is called by 1 function(s): write.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free