Home / Function/ handleNewChannel() — netty Function Reference

handleNewChannel() — netty Function Reference

Architecture documentation for the handleNewChannel() function in AbstractRemoteAddressFilter.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  2cbb3691_64ac_6c04_d925_484365af8fa0["handleNewChannel()"]
  ddea06e1_37ed_030d_4926_4c0a65889850["AbstractRemoteAddressFilter"]
  2cbb3691_64ac_6c04_d925_484365af8fa0 -->|defined in| ddea06e1_37ed_030d_4926_4c0a65889850
  785c2b49_0de3_0c13_0be6_e595ab67c431["channelRegistered()"]
  785c2b49_0de3_0c13_0be6_e595ab67c431 -->|calls| 2cbb3691_64ac_6c04_d925_484365af8fa0
  2a1c9690_a411_fed1_15df_96d6297ea424["channelActive()"]
  2a1c9690_a411_fed1_15df_96d6297ea424 -->|calls| 2cbb3691_64ac_6c04_d925_484365af8fa0
  dbe1eae3_eb68_cf1a_d22c_dabf08b603d5["accept()"]
  2cbb3691_64ac_6c04_d925_484365af8fa0 -->|calls| dbe1eae3_eb68_cf1a_d22c_dabf08b603d5
  2be83267_e5ea_8355_96e0_ccdfd6570d96["channelAccepted()"]
  2cbb3691_64ac_6c04_d925_484365af8fa0 -->|calls| 2be83267_e5ea_8355_96e0_ccdfd6570d96
  style 2cbb3691_64ac_6c04_d925_484365af8fa0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java lines 55–80

    private boolean handleNewChannel(ChannelHandlerContext ctx) throws Exception {
        @SuppressWarnings("unchecked")
        T remoteAddress = (T) ctx.channel().remoteAddress();

        // If the remote address is not available yet, defer the decision.
        if (remoteAddress == null) {
            return false;
        }

        // No need to keep this handler in the pipeline anymore because the decision is going to be made now.
        // Also, this will prevent the subsequent events from being handled by this handler.
        ctx.pipeline().remove(this);

        if (accept(ctx, remoteAddress)) {
            channelAccepted(ctx, remoteAddress);
        } else {
            ChannelFuture rejectedFuture = channelRejected(ctx, remoteAddress);
            if (rejectedFuture != null) {
                rejectedFuture.addListener(ChannelFutureListener.CLOSE);
            } else {
                ctx.close();
            }
        }

        return true;
    }

Domain

Subdomains

Frequently Asked Questions

What does handleNewChannel() do?
handleNewChannel() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java.
Where is handleNewChannel() defined?
handleNewChannel() is defined in handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java at line 55.
What does handleNewChannel() call?
handleNewChannel() calls 2 function(s): accept, channelAccepted.
What calls handleNewChannel()?
handleNewChannel() is called by 2 function(s): channelActive, channelRegistered.

Analyze Your Own Codebase

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

Try Supermodel Free