@Test void start() throws InterruptedException { final DssTcpServer dssTcpServer = new DssTcpServer("127.0.0.1", 8181); stopDssTcpServerAfterActivated(dssTcpServer, 10, 15); dssTcpServer.start(); assertTrue(dssTcpServer.isShutdown()); }
public void start() throws InterruptedException { final DssTcpChannelInitializer channelInitializer = dssTcpChannelInitializer(); EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssTcpChannelProperty property = newDssTcpChannelProperty(); try { final DssTcpChannel dssTcpChannel = new DssTcpChannel(); channel = dssTcpChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } }
DssTcpServer { public void start() throws InterruptedException { final DssTcpChannelInitializer channelInitializer = dssTcpChannelInitializer(); EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssTcpChannelProperty property = newDssTcpChannelProperty(); try { final DssTcpChannel dssTcpChannel = new DssTcpChannel(); channel = dssTcpChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } }
DssTcpServer { public void start() throws InterruptedException { final DssTcpChannelInitializer channelInitializer = dssTcpChannelInitializer(); EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssTcpChannelProperty property = newDssTcpChannelProperty(); try { final DssTcpChannel dssTcpChannel = new DssTcpChannel(); channel = dssTcpChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } DssTcpServer(String host, int port);  DssTcpServer(String host, int port, boolean ssl, SslContext sslContext); }
DssTcpServer { public void start() throws InterruptedException { final DssTcpChannelInitializer channelInitializer = dssTcpChannelInitializer(); EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssTcpChannelProperty property = newDssTcpChannelProperty(); try { final DssTcpChannel dssTcpChannel = new DssTcpChannel(); channel = dssTcpChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } DssTcpServer(String host, int port);  DssTcpServer(String host, int port, boolean ssl, SslContext sslContext); void start(); void stop(); boolean isActivated(); boolean isShutdown(); }
DssTcpServer { public void start() throws InterruptedException { final DssTcpChannelInitializer channelInitializer = dssTcpChannelInitializer(); EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssTcpChannelProperty property = newDssTcpChannelProperty(); try { final DssTcpChannel dssTcpChannel = new DssTcpChannel(); channel = dssTcpChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } DssTcpServer(String host, int port);  DssTcpServer(String host, int port, boolean ssl, SslContext sslContext); void start(); void stop(); boolean isActivated(); boolean isShutdown();  }