public void start() throws InterruptedException { bossGroup = new NioEventLoopGroup(); workerGroup = new NioEventLoopGroup(); final ServerBootstrap b = new ServerBootstrap(); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .option(ChannelOption.SO_BACKLOG, 128) .childOption(ChannelOption.SO_KEEPALIVE, true) .childHandler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast(new LoggingHandler()); ch.pipeline().addLast(new XmlFrameDecoder(2147483647)); ch.pipeline().addLast(new XmlEventProcessor(eventIpcManager)); } }); // Bind and start to accept incoming connections. future = b.bind(config.getTCPIpAddress(), config.getTCPPort()).sync().await(); }
public void start() throws InterruptedException { bossGroup = new NioEventLoopGroup(); workerGroup = new NioEventLoopGroup(); final ServerBootstrap b = new ServerBootstrap(); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .option(ChannelOption.SO_BACKLOG, 128) .childOption(ChannelOption.SO_KEEPALIVE, true) .childHandler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast(new LoggingHandler()); ch.pipeline().addLast(new XmlFrameDecoder(2147483647)); ch.pipeline().addLast(new XmlEventProcessor(eventIpcManager)); } }); // Bind and start to accept incoming connections. future = b.bind(config.getTCPIpAddress(), config.getTCPPort()).sync().await(); }