io.netty.channel.sctp.SctpChannelOption Java Examples
The following examples show how to use
io.netty.channel.sctp.SctpChannelOption.
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: SimpleSctpClient.java From netty-cookbook with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws Exception { EventLoopGroup loopGroup = new NioEventLoopGroup(); try { ChannelFuture f = new Bootstrap().group(loopGroup) .channel(NioSctpChannel.class) // set SCTP option .option(SctpChannelOption.SCTP_NODELAY, true) .handler(new ChannelInitializer<SctpChannel>() { @Override public void initChannel(SctpChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); p.addLast(new SimpleSctpClientHandler()); } }).connect(HOST, PORT).sync(); f.channel().closeFuture().sync(); } finally { loopGroup.shutdownGracefully(); } }
Example #2
Source File: SimpleSctpClient.java From netty-cookbook with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws Exception { EventLoopGroup loopGroup = new NioEventLoopGroup(); try { ChannelFuture f = new Bootstrap().group(loopGroup) .channel(NioSctpChannel.class) // set SCTP option .option(SctpChannelOption.SCTP_NODELAY, true) .handler(new ChannelInitializer<SctpChannel>() { @Override public void initChannel(SctpChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); p.addLast(new SimpleSctpClientHandler()); } }).connect(HOST, PORT).sync(); f.channel().closeFuture().sync(); } finally { loopGroup.shutdownGracefully(); } }
Example #3
Source File: SctpEchoClient.java From netty-4.1.22 with Apache License 2.0 | 5 votes |
public static void main(String[] args) throws Exception { // Configure the client. EventLoopGroup group = new NioEventLoopGroup(); try { Bootstrap b = new Bootstrap(); b.group(group) .channel(NioSctpChannel.class) .option(SctpChannelOption.SCTP_NODELAY, true) .handler(new ChannelInitializer<SctpChannel>() { @Override public void initChannel(SctpChannel ch) throws Exception { ch.pipeline().addLast( //new LoggingHandler(LogLevel.INFO), new SctpEchoClientHandler()); } }); // Start the client. ChannelFuture f = b.connect(HOST, PORT).sync(); // Wait until the connection is closed. f.channel().closeFuture().sync(); } finally { // Shut down the event loop to terminate all threads. group.shutdownGracefully(); } }
Example #4
Source File: SctpEchoClient.java From netty4.0.27Learn with Apache License 2.0 | 5 votes |
public static void main(String[] args) throws Exception { // Configure the client. EventLoopGroup group = new NioEventLoopGroup(); try { Bootstrap b = new Bootstrap(); b.group(group) .channel(NioSctpChannel.class) .option(SctpChannelOption.SCTP_NODELAY, true) .handler(new ChannelInitializer<SctpChannel>() { @Override public void initChannel(SctpChannel ch) throws Exception { ch.pipeline().addLast( //new LoggingHandler(LogLevel.INFO), new SctpEchoClientHandler()); } }); // Start the client. ChannelFuture f = b.connect(HOST, PORT).sync(); // Wait until the connection is closed. f.channel().closeFuture().sync(); } finally { // Shut down the event loop to terminate all threads. group.shutdownGracefully(); } }
Example #5
Source File: NettyServerImpl.java From sctp with GNU Affero General Public License v3.0 | 5 votes |
private void applySctpOptions(ServerBootstrap b) { b.childOption(SctpChannelOption.SCTP_NODELAY, this.management.getOptionSctpNodelay()); b.childOption(SctpChannelOption.SCTP_DISABLE_FRAGMENTS, this.management.getOptionSctpDisableFragments()); b.childOption(SctpChannelOption.SCTP_FRAGMENT_INTERLEAVE, this.management.getOptionSctpFragmentInterleave()); b.childOption(SctpChannelOption.SCTP_INIT_MAXSTREAMS, this.management.getOptionSctpInitMaxstreams()); b.childOption(SctpChannelOption.SO_SNDBUF, this.management.getOptionSoSndbuf()); b.childOption(SctpChannelOption.SO_RCVBUF, this.management.getOptionSoRcvbuf()); b.childOption(SctpChannelOption.SO_LINGER, this.management.getOptionSoLinger()); }
Example #6
Source File: NettyAssociationImpl.java From sctp with GNU Affero General Public License v3.0 | 5 votes |
private void applySctpOptions(Bootstrap b) { b.option(SctpChannelOption.SCTP_NODELAY, this.management.getOptionSctpNodelay()); b.option(SctpChannelOption.SCTP_DISABLE_FRAGMENTS, this.management.getOptionSctpDisableFragments()); b.option(SctpChannelOption.SCTP_FRAGMENT_INTERLEAVE, this.management.getOptionSctpFragmentInterleave()); b.option(SctpChannelOption.SCTP_INIT_MAXSTREAMS, this.management.getOptionSctpInitMaxstreams()); b.option(SctpChannelOption.SO_SNDBUF, this.management.getOptionSoSndbuf()); b.option(SctpChannelOption.SO_RCVBUF, this.management.getOptionSoRcvbuf()); b.option(SctpChannelOption.SO_LINGER, this.management.getOptionSoLinger()); }