readFrame() — netty Function Reference
Architecture documentation for the readFrame() function in DefaultHttp2FrameReader.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f53e0d0e_4159_3b85_497b_bc55cfb15681["readFrame()"] 3768d640_58c2_34e7_3d69_a4b578e0d11a["DefaultHttp2FrameReader"] f53e0d0e_4159_3b85_497b_bc55cfb15681 -->|defined in| 3768d640_58c2_34e7_3d69_a4b578e0d11a 969e7b9f_005c_0301_2983_56e986f1d510["preProcessFrame()"] f53e0d0e_4159_3b85_497b_bc55cfb15681 -->|calls| 969e7b9f_005c_0301_2983_56e986f1d510 80aaad85_d41e_97a8_6671_ac352891e88f["verifyFrameState()"] f53e0d0e_4159_3b85_497b_bc55cfb15681 -->|calls| 80aaad85_d41e_97a8_6671_ac352891e88f e711693c_32ed_ac69_29f1_ce5694750979["processPayloadState()"] f53e0d0e_4159_3b85_497b_bc55cfb15681 -->|calls| e711693c_32ed_ac69_29f1_ce5694750979 style f53e0d0e_4159_3b85_497b_bc55cfb15681 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2FrameReader.java lines 137–176
@Override
public void readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
throws Http2Exception {
if (readError) {
input.skipBytes(input.readableBytes());
return;
}
try {
do {
if (readingHeaders && !preProcessFrame(input)) {
return;
}
// The header is complete, fall into the next case to process the payload.
// This is to ensure the proper handling of zero-length payloads. In this
// case, we don't want to loop around because there may be no more data
// available, causing us to exit the loop. Instead, we just want to perform
// the first pass at payload processing now.
// Wait until the entire payload has been read.
if (input.readableBytes() < payloadLength) {
return;
}
// Slice to work only on the frame being read
ByteBuf framePayload = input.readSlice(payloadLength);
// We have consumed the data for this frame, next time we read,
// we will be expecting to read a new frame header.
readingHeaders = true;
verifyFrameState();
processPayloadState(ctx, framePayload, listener);
} while (input.isReadable());
} catch (Http2Exception e) {
readError = !Http2Exception.isStreamError(e);
throw e;
} catch (RuntimeException e) {
readError = true;
throw e;
} catch (Throwable cause) {
readError = true;
PlatformDependent.throwException(cause);
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does readFrame() do?
readFrame() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2FrameReader.java.
Where is readFrame() defined?
readFrame() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2FrameReader.java at line 137.
What does readFrame() call?
readFrame() calls 3 function(s): preProcessFrame, processPayloadState, verifyFrameState.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free