Home / Function/ closeIfNeeded() — netty Function Reference

closeIfNeeded() — netty Function Reference

Architecture documentation for the closeIfNeeded() function in QuicheQuicStreamChannel.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  02ba6530_dd1d_7e69_71f0_2ab5b91e6586["closeIfNeeded()"]
  77188bb7_e7ad_de01_3b54_5bc50b9e2df1["QuicStreamChannelUnsafe"]
  02ba6530_dd1d_7e69_71f0_2ab5b91e6586 -->|defined in| 77188bb7_e7ad_de01_3b54_5bc50b9e2df1
  da5c2828_c8c5_6172_4f45_d61e57ed89ae["writeQueued()"]
  da5c2828_c8c5_6172_4f45_d61e57ed89ae -->|calls| 02ba6530_dd1d_7e69_71f0_2ab5b91e6586
  c225604c_2de8_fe76_73d8_f8ebd8b0d632["writeWithoutCheckChannelState()"]
  c225604c_2de8_fe76_73d8_f8ebd8b0d632 -->|calls| 02ba6530_dd1d_7e69_71f0_2ab5b91e6586
  1123715f_0f63_323f_9bab_77f6d3c50fff["close()"]
  02ba6530_dd1d_7e69_71f0_2ab5b91e6586 -->|calls| 1123715f_0f63_323f_9bab_77f6d3c50fff
  style 02ba6530_dd1d_7e69_71f0_2ab5b91e6586 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicStreamChannel.java lines 665–675

        private void closeIfNeeded(boolean wasFinSent) {
            // Let's check if we should close the channel now.
            // If it's a unidirectional channel we can close it as there will be no fin that we can read
            // from the remote peer. If its an bidirectional channel we should only close the channel if we
            // also received the fin from the remote peer.
            if (!wasFinSent && QuicheQuicStreamChannel.this.finSent
                    && (type() == QuicStreamType.UNIDIRECTIONAL || finReceived)) {
                // close the channel now
                close(voidPromise());
            }
        }

Domain

Subdomains

Calls

Frequently Asked Questions

What does closeIfNeeded() do?
closeIfNeeded() is a function in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicStreamChannel.java.
Where is closeIfNeeded() defined?
closeIfNeeded() is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicStreamChannel.java at line 665.
What does closeIfNeeded() call?
closeIfNeeded() calls 1 function(s): close.
What calls closeIfNeeded()?
closeIfNeeded() is called by 2 function(s): writeQueued, writeWithoutCheckChannelState.

Analyze Your Own Codebase

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

Try Supermodel Free