@Test void start() throws InterruptedException { final DssWebSocketServer dssWebSocketServer = new DssWebSocketServer("127.0.0.1", 8181); stopDssWebSocketServerAfterActivated(dssWebSocketServer, 10, 15); dssWebSocketServer.start(); assertTrue(dssWebSocketServer.isShutdown()); }
@Override public void start() throws InterruptedException { final DssWebSocketChannelInitializer channelInitializer = dssWebsocketChannelInitializer(); final EventLoopGroup bossGroup = new NioEventLoopGroup(); final EventLoopGroup workerGroup = new NioEventLoopGroup(); final ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssWebSocketChannelProperty property = newDssWebsocketChannelProperty(); try { final DssWebSocketChannel dssWebsocketChannel = new DssWebSocketChannel(); channel = dssWebsocketChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); logger.info("Server Started"); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } }
DssWebSocketServer implements DssServer { @Override public void start() throws InterruptedException { final DssWebSocketChannelInitializer channelInitializer = dssWebsocketChannelInitializer(); final EventLoopGroup bossGroup = new NioEventLoopGroup(); final EventLoopGroup workerGroup = new NioEventLoopGroup(); final ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssWebSocketChannelProperty property = newDssWebsocketChannelProperty(); try { final DssWebSocketChannel dssWebsocketChannel = new DssWebSocketChannel(); channel = dssWebsocketChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); logger.info("Server Started"); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } }
DssWebSocketServer implements DssServer { @Override public void start() throws InterruptedException { final DssWebSocketChannelInitializer channelInitializer = dssWebsocketChannelInitializer(); final EventLoopGroup bossGroup = new NioEventLoopGroup(); final EventLoopGroup workerGroup = new NioEventLoopGroup(); final ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssWebSocketChannelProperty property = newDssWebsocketChannelProperty(); try { final DssWebSocketChannel dssWebsocketChannel = new DssWebSocketChannel(); channel = dssWebsocketChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); logger.info("Server Started"); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } DssWebSocketServer(String host, int port);  DssWebSocketServer(String host, int port, DssLogLevel dssLogLevel);  DssWebSocketServer(String host, int port, DssLogLevel dssLogLevel, boolean ssl, SslContext sslContext); }
DssWebSocketServer implements DssServer { @Override public void start() throws InterruptedException { final DssWebSocketChannelInitializer channelInitializer = dssWebsocketChannelInitializer(); final EventLoopGroup bossGroup = new NioEventLoopGroup(); final EventLoopGroup workerGroup = new NioEventLoopGroup(); final ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssWebSocketChannelProperty property = newDssWebsocketChannelProperty(); try { final DssWebSocketChannel dssWebsocketChannel = new DssWebSocketChannel(); channel = dssWebsocketChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); logger.info("Server Started"); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } DssWebSocketServer(String host, int port);  DssWebSocketServer(String host, int port, DssLogLevel dssLogLevel);  DssWebSocketServer(String host, int port, DssLogLevel dssLogLevel, boolean ssl, SslContext sslContext); @Override void start(); @Override void stop(); @Override boolean isActivated(); @Override boolean isShutdown(); @Override DssServer addDssService(DssActorService service); @Override DssServer addExceptionHandler(DssExceptionHandler exceptionHandler); }
DssWebSocketServer implements DssServer { @Override public void start() throws InterruptedException { final DssWebSocketChannelInitializer channelInitializer = dssWebsocketChannelInitializer(); final EventLoopGroup bossGroup = new NioEventLoopGroup(); final EventLoopGroup workerGroup = new NioEventLoopGroup(); final ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup); final DssWebSocketChannelProperty property = newDssWebsocketChannelProperty(); try { final DssWebSocketChannel dssWebsocketChannel = new DssWebSocketChannel(); channel = dssWebsocketChannel.bind(bootstrap, property, channelInitializer); active.set(true); shutdown.set(false); logger.info("Server Started"); channel.closeFuture().sync(); } finally { logger.info("Shut down worker and boss group gracefully"); workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); shutdown.set(true); } } DssWebSocketServer(String host, int port);  DssWebSocketServer(String host, int port, DssLogLevel dssLogLevel);  DssWebSocketServer(String host, int port, DssLogLevel dssLogLevel, boolean ssl, SslContext sslContext); @Override void start(); @Override void stop(); @Override boolean isActivated(); @Override boolean isShutdown(); @Override DssServer addDssService(DssActorService service); @Override DssServer addExceptionHandler(DssExceptionHandler exceptionHandler);  }