Package io.netty.channel.nio

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()


            ChannelFuture future = channel.closeFuture().sync();
            future.addListener(ChannelFutureListener.CLOSE);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        } finally {
            group.shutdownGracefully();
        }
    }
}
View Full Code Here


            ch.writeAndFlush(new CloseWebSocketFrame());

            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }

    @Test
    public void userAgentReaper() throws Exception {
View Full Code Here

            final ChannelFuture registerFuture = ch.writeAndFlush(new TextWebSocketFrame(register));
            registerFuture.sync();
            ch.writeAndFlush(new CloseWebSocketFrame());
            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }

}
View Full Code Here

            logger.info("Server started");
            logger.debug(config.toString());
            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }

    /**
     * Starts the server using an optional passed in configuration file.
View Full Code Here

            final Channel ch = sb.bind(port).sync().channel();
            System.out.println("Web socket server started on port [" + port + "], ");
            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }

    private static SockJsServiceFactory echoService() {
        final SockJsConfig config = SockJsConfig.withPrefix("/echo")
View Full Code Here

            // Multipart Post form: factory used
            formpostmultipart(b, host, port, uriFile, factory, headers, bodylist);
        } finally {
            // Shut down executor threads to exit.
            group.shutdownGracefully();

            // Really clean all temporary files if they still exist
            factory.cleanAllHttpData();
        }
    }
View Full Code Here

        } catch (Exception e) {
          logger.debug("Exception: {} ({})", e.getMessage(), e.getClass().getName());
            throw new Error("Server Disconnnected");
        } finally {
          workerGroup.shutdownGracefully();

        }
    }

}
View Full Code Here

        } catch (Exception e) {
          logger.debug("Exception: {} ({})", e.getMessage(), e.getClass().getName());
            throw new Error("Disconnnected");
        } finally {
          workerGroup.shutdownGracefully();

            if (!peerDiscoveryMode){
//                EthereumListener listener =  WorldManager.getInstance().getListener();
//                listener.onPeerDisconnect(host, port);
            }
View Full Code Here

        } catch (Exception e) {
          logger.debug("Exception: {} ({})", e.getMessage(), e.getClass().getName());
            throw new Error("Disconnnected");
        } finally {
          workerGroup.shutdownGracefully();
        }
    }

}
View Full Code Here

                 }
             });
            ChannelFuture f = b.bind().sync();
            f.channel().closeFuture().sync();
        } finally {
            group.shutdownGracefully().sync();
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.