io.netty.channel.sctp.SctpServerChannel Java Examples

The following examples show how to use io.netty.channel.sctp.SctpServerChannel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OioSctpChannel.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
public SctpServerChannel parent() {
    return (SctpServerChannel) super.parent();
}
 
Example #2
Source File: NioSctpChannel.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
public SctpServerChannel parent() {
    return (SctpServerChannel) super.parent();
}
 
Example #3
Source File: OioSctpLimitStreamsTest.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
protected Class<? extends SctpServerChannel> serverClass() {
    return OioSctpServerChannel.class;
}
 
Example #4
Source File: NioSctpLimitStreamsTest.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
protected Class<? extends SctpServerChannel> serverClass() {
    return NioSctpServerChannel.class;
}
 
Example #5
Source File: OioSctpChannel.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
@Override
public SctpServerChannel parent() {
    return (SctpServerChannel) super.parent();
}
 
Example #6
Source File: NioSctpChannel.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
@Override
public SctpServerChannel parent() {
    return (SctpServerChannel) super.parent();
}
 
Example #7
Source File: NettyServerImpl.java    From sctp with GNU Affero General Public License v3.0 4 votes vote down vote up
private void initSocket() throws Exception {
    ServerBootstrap b = new ServerBootstrap();
    b.group(this.management.getBossGroup(), this.management.getWorkerGroup());
    if (this.ipChannelType == IpChannelType.SCTP) {
        b.channel(NioSctpServerChannel.class);
        b.option(ChannelOption.SO_BACKLOG, 100);
        b.childHandler(new NettySctpServerChannelInitializer(this, this.management));
        this.applySctpOptions(b);
    } else {
        b.channel(NioServerSocketChannel.class);
        b.option(ChannelOption.SO_BACKLOG, 100);
        b.childHandler(new NettyTcpServerChannelInitializer(this, this.management));
    }
    b.handler(new LoggingHandler(LogLevel.INFO));

    InetSocketAddress localAddress = new InetSocketAddress(this.hostAddress, this.hostport);

    // Bind the server to primary address.
    ChannelFuture channelFuture = b.bind(localAddress).sync();

    // Get the underlying sctp channel
    if (this.ipChannelType == IpChannelType.SCTP) {
        this.serverChannelSctp = (SctpServerChannel) channelFuture.channel();

        // Bind the secondary address.
        // Please note that, bindAddress in the client channel should be done before connecting if you have not
        // enable Dynamic Address Configuration. See net.sctp.addip_enable kernel param
        if (this.extraHostAddresses != null) {
            for (int count = 0; count < this.extraHostAddresses.length; count++) {
                String localSecondaryAddress = this.extraHostAddresses[count];
                InetAddress localSecondaryInetAddress = InetAddress.getByName(localSecondaryAddress);

                channelFuture = this.serverChannelSctp.bindAddress(localSecondaryInetAddress).sync();
            }
        }

        if (logger.isInfoEnabled()) {
            logger.info(String.format("SctpServerChannel bound to=%s ", this.serverChannelSctp.allLocalAddresses()));
        }
    } else {
        this.serverChannelTcp = (NioServerSocketChannel) channelFuture.channel();

        if (logger.isInfoEnabled()) {
            logger.info(String.format("ServerSocketChannel bound to=%s ", this.serverChannelTcp.localAddress()));
        }
    }
}