Home / Class/ OioSctpServerChannel Class — netty Architecture

OioSctpServerChannel Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  6afb1ded_b47f_ea85_aaad_a3a81300c88f["OioSctpServerChannel"]
  44705287_0082_7a6c_c58c_3ff97ed2172d["OioSctpServerChannel.java"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|defined in| 44705287_0082_7a6c_c58c_3ff97ed2172d
  3625fc72_d732_b47d_c9b5_30597305994e["SctpServerChannel()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 3625fc72_d732_b47d_c9b5_30597305994e
  dc50a21a_c3a6_b135_4842_b9dec626be78["OioSctpServerChannel()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| dc50a21a_c3a6_b135_4842_b9dec626be78
  4afeb3c6_1bd1_9401_1504_f6cef51ba7fb["ChannelMetadata()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 4afeb3c6_1bd1_9401_1504_f6cef51ba7fb
  c6bf233f_a66f_a3ae_bd1c_0cd113a9a1c6["SctpServerChannelConfig()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| c6bf233f_a66f_a3ae_bd1c_0cd113a9a1c6
  d18d520e_ff03_44d1_9d43_fb885a42437e["InetSocketAddress()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| d18d520e_ff03_44d1_9d43_fb885a42437e
  305262bf_cc75_ab4c_8ff5_1b0e419b2d2d["isOpen()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 305262bf_cc75_ab4c_8ff5_1b0e419b2d2d
  7d3821e2_2629_1984_ea3c_dd84c033b812["SocketAddress()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 7d3821e2_2629_1984_ea3c_dd84c033b812
  6cafbfd4_b762_f2a5_f6ec_53d5b72d41bc["allLocalAddresses()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 6cafbfd4_b762_f2a5_f6ec_53d5b72d41bc
  cc024ebd_6a64_6081_9544_eb2ffce0acec["isActive()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| cc024ebd_6a64_6081_9544_eb2ffce0acec
  a269c023_7423_1f2f_d27a_9e943bfb748d["doBind()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| a269c023_7423_1f2f_d27a_9e943bfb748d
  40b7903b_c92b_d334_94de_3c73e9435804["doClose()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 40b7903b_c92b_d334_94de_3c73e9435804
  ff282730_6a0a_2538_3851_86e4c5047cb3["doReadMessages()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| ff282730_6a0a_2538_3851_86e4c5047cb3
  2ea9ed56_37c5_5eba_c3d9_22cf2a50a4b7["ChannelFuture()"]
  6afb1ded_b47f_ea85_aaad_a3a81300c88f -->|method| 2ea9ed56_37c5_5eba_c3d9_22cf2a50a4b7

Relationship Graph

Source Code

transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpServerChannel.java lines 53–308

@Deprecated
public class OioSctpServerChannel extends AbstractOioMessageChannel
        implements io.netty.channel.sctp.SctpServerChannel {

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

    private static final ChannelMetadata METADATA = new ChannelMetadata(false, 1);

    private static SctpServerChannel newServerSocket() {
        try {
            return SctpServerChannel.open();
        } catch (IOException e) {
            throw new ChannelException("failed to create a sctp server channel", e);
        }
    }

    private final SctpServerChannel sch;
    private final SctpServerChannelConfig config;
    private final Selector selector;

    /**
     * Create a new instance with an new {@link SctpServerChannel}
     */
    public OioSctpServerChannel() {
        this(newServerSocket());
    }

    /**
     * Create a new instance from the given {@link SctpServerChannel}
     *
     * @param sch    the {@link SctpServerChannel} which is used by this instance
     */
    public OioSctpServerChannel(SctpServerChannel sch) {
        super(null);
        this.sch = ObjectUtil.checkNotNull(sch, "sctp server channel");
        boolean success = false;
        try {
            sch.configureBlocking(false);
            selector = Selector.open();
            sch.register(selector, SelectionKey.OP_ACCEPT);
            config = new OioSctpServerChannelConfig(this, sch);
            success = true;
        } catch (Exception e) {
            throw new ChannelException("failed to initialize a sctp server channel", e);
        } finally {
            if (!success) {
                try {
                    sch.close();
                } catch (IOException e) {
                    logger.warn("Failed to close a sctp server channel.", e);
                }
            }
        }
    }

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

    @Override
    public SctpServerChannelConfig config() {
        return config;
    }

    @Override
    public InetSocketAddress remoteAddress() {
        return null;
    }

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

    @Override
    public boolean isOpen() {
        return sch.isOpen();
    }

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free