Home / Function/ failIfNecessary() — netty Function Reference

failIfNecessary() — netty Function Reference

Architecture documentation for the failIfNecessary() function in LengthFieldBasedFrameDecoder.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  85c6af4f_525c_0286_9d46_f6cb70186ae3["failIfNecessary()"]
  687df7d8_4057_fca4_6694_3143553abf69["LengthFieldBasedFrameDecoder"]
  85c6af4f_525c_0286_9d46_f6cb70186ae3 -->|defined in| 687df7d8_4057_fca4_6694_3143553abf69
  eccb157b_d7cc_e4ef_8e1a_92c29ab6d4cd["discardingTooLongFrame()"]
  eccb157b_d7cc_e4ef_8e1a_92c29ab6d4cd -->|calls| 85c6af4f_525c_0286_9d46_f6cb70186ae3
  afaf5979_a43d_e80f_807f_08d92b1bd469["exceededFrameLength()"]
  afaf5979_a43d_e80f_807f_08d92b1bd469 -->|calls| 85c6af4f_525c_0286_9d46_f6cb70186ae3
  377d60e8_ded7_845a_5e05_1f5044b18794["fail()"]
  85c6af4f_525c_0286_9d46_f6cb70186ae3 -->|calls| 377d60e8_ded7_845a_5e05_1f5044b18794
  style 85c6af4f_525c_0286_9d46_f6cb70186ae3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java lines 480–496

    private void failIfNecessary(boolean firstDetectionOfTooLongFrame) {
        if (bytesToDiscard == 0) {
            // Reset to the initial state and tell the handlers that
            // the frame was too large.
            long tooLongFrameLength = this.tooLongFrameLength;
            this.tooLongFrameLength = 0;
            discardingTooLongFrame = false;
            if (!failFast || firstDetectionOfTooLongFrame) {
                fail(tooLongFrameLength);
            }
        } else {
            // Keep discarding and notify handlers if necessary.
            if (failFast && firstDetectionOfTooLongFrame) {
                fail(tooLongFrameLength);
            }
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does failIfNecessary() do?
failIfNecessary() is a function in the netty codebase, defined in codec-base/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java.
Where is failIfNecessary() defined?
failIfNecessary() is defined in codec-base/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java at line 480.
What does failIfNecessary() call?
failIfNecessary() calls 1 function(s): fail.
What calls failIfNecessary()?
failIfNecessary() is called by 2 function(s): discardingTooLongFrame, exceededFrameLength.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free