Home / Class/ NioSctpChannel Class — netty Architecture

NioSctpChannel Class — netty Architecture

Architecture documentation for the NioSctpChannel class in NioSctpChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54["NioSctpChannel"]
  bd336ba5_323f_7a66_04fb_9be9f7bab798["NioSctpChannel.java"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|defined in| bd336ba5_323f_7a66_04fb_9be9f7bab798
  885b6a35_aefb_5df9_b6fd_5568a482e1a5["SctpChannel()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| 885b6a35_aefb_5df9_b6fd_5568a482e1a5
  505c7770_3820_e050_e335_6d4a1d4e6323["NioSctpChannel()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| 505c7770_3820_e050_e335_6d4a1d4e6323
  b8015926_fbd3_3466_37da_e3401cb733c9["InetSocketAddress()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| b8015926_fbd3_3466_37da_e3401cb733c9
  484ea328_a0c5_2b68_e2de_360dd405728b["SctpServerChannel()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| 484ea328_a0c5_2b68_e2de_360dd405728b
  3a7f5e13_7eb7_b043_6f92_1163074a9147["ChannelMetadata()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| 3a7f5e13_7eb7_b043_6f92_1163074a9147
  be27f276_7f1d_1110_cb58_bec65b6575b1["Association()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| be27f276_7f1d_1110_cb58_bec65b6575b1
  47b6187b_ee10_295a_ee5e_e9401a473c27["allLocalAddresses()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| 47b6187b_ee10_295a_ee5e_e9401a473c27
  aa61cb23_14e5_c597_a9b5_228bfaddeaea["SctpChannelConfig()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| aa61cb23_14e5_c597_a9b5_228bfaddeaea
  d8962271_ef15_9ed8_464e_4bb035dc387f["allRemoteAddresses()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| d8962271_ef15_9ed8_464e_4bb035dc387f
  500557bf_4744_f2e6_d571_8a7dceb76f14["isActive()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| 500557bf_4744_f2e6_d571_8a7dceb76f14
  c659cd46_8203_05f7_4a1f_d7e3933579a1["SocketAddress()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| c659cd46_8203_05f7_4a1f_d7e3933579a1
  aca704bb_b5f0_17c9_fd2b_4a47e67d371d["doBind()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| aca704bb_b5f0_17c9_fd2b_4a47e67d371d
  ddc6f272_f305_a0ae_1f93_04e3ac83dbdc["doConnect()"]
  ce6c049a_7822_1e77_29fc_0d83a1e2ef54 -->|method| ddc6f272_f305_a0ae_1f93_04e3ac83dbdc

Relationship Graph

Source Code

transport-sctp/src/main/java/io/netty/channel/sctp/nio/NioSctpChannel.java lines 62–427

public class NioSctpChannel extends AbstractNioMessageChannel implements io.netty.channel.sctp.SctpChannel {
    private static final ChannelMetadata METADATA = new ChannelMetadata(false);

    private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSctpChannel.class);

    private final SctpChannelConfig config;

    private final NotificationHandler<?> notificationHandler;
    private ByteBuffer inputCopy;
    private ByteBuffer outputCopy;

    private static SctpChannel newSctpChannel() {
        try {
            return SctpChannel.open();
        } catch (IOException e) {
            throw new ChannelException("Failed to open a sctp channel.", e);
        }
    }

    /**
     * Create a new instance
     */
    public NioSctpChannel() {
        this(newSctpChannel());
    }

    /**
     * Create a new instance using {@link SctpChannel}
     */
    public NioSctpChannel(SctpChannel sctpChannel) {
        this(null, sctpChannel);
    }

    /**
     * Create a new instance
     *
     * @param parent        the {@link Channel} which is the parent of this {@link NioSctpChannel}
     *                      or {@code null}.
     * @param sctpChannel   the underlying {@link SctpChannel}
     */
    public NioSctpChannel(Channel parent, SctpChannel sctpChannel) {
        super(parent, sctpChannel, SelectionKey.OP_READ);
        try {
            sctpChannel.configureBlocking(false);
            config = new NioSctpChannelConfig(this, sctpChannel);
            notificationHandler = new SctpNotificationHandler(this);
        } catch (IOException e) {
            try {
                sctpChannel.close();
            } catch (IOException e2) {
                if (logger.isWarnEnabled()) {
                    logger.warn(
                            "Failed to close a partially initialized sctp channel.", e2);
                }
            }

            throw new ChannelException("Failed to enter non-blocking mode.", e);
        }
    }

    @Override
    public InetSocketAddress localAddress() {
        return (InetSocketAddress) super.localAddress();
    }

    @Override
    public InetSocketAddress remoteAddress() {
        return (InetSocketAddress) super.remoteAddress();
    }

    @Override
    public SctpServerChannel parent() {
        return (SctpServerChannel) super.parent();
    }

    @Override
    public ChannelMetadata metadata() {
        return METADATA;
    }

    @Override

Frequently Asked Questions

What is the NioSctpChannel class?
NioSctpChannel is a class in the netty codebase, defined in transport-sctp/src/main/java/io/netty/channel/sctp/nio/NioSctpChannel.java.
Where is NioSctpChannel defined?
NioSctpChannel is defined in transport-sctp/src/main/java/io/netty/channel/sctp/nio/NioSctpChannel.java at line 62.

Analyze Your Own Codebase

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

Try Supermodel Free