public void start() throws InterruptedException { bossGroup = new NioEventLoopGroup(); final Bootstrap b = new Bootstrap() .group(bossGroup) .channel(NioDatagramChannel.class) .option(ChannelOption.SO_REUSEADDR, true) .option(ChannelOption.SO_RCVBUF, Integer.MAX_VALUE) .handler(new ChannelInitializer<DatagramChannel>() { @Override protected void initChannel(DatagramChannel ch) throws Exception { ch.pipeline().addLast(new LoggingHandler()); ch.pipeline().addLast(new MessageToMessageDecoder<DatagramPacket>() { @Override protected void decode(ChannelHandlerContext ctx, DatagramPacket msg, List<Object> out) throws Exception { msg.retain(); out.add(msg.content()); } }); ch.pipeline().addLast(new XmlFrameDecoder(2147483647)); ch.pipeline().addLast(new XmlEventProcessor(eventIpcManager)); } }); future = b.bind(config.getUDPIpAddress(), config.getUDPPort()).await(); }
public void start() throws InterruptedException { bossGroup = new NioEventLoopGroup(); final Bootstrap b = new Bootstrap() .group(bossGroup) .channel(NioDatagramChannel.class) .option(ChannelOption.SO_REUSEADDR, true) .option(ChannelOption.SO_RCVBUF, Integer.MAX_VALUE) .handler(new ChannelInitializer<DatagramChannel>() { @Override protected void initChannel(DatagramChannel ch) throws Exception { ch.pipeline().addLast(new LoggingHandler()); ch.pipeline().addLast(new MessageToMessageDecoder<DatagramPacket>() { @Override protected void decode(ChannelHandlerContext ctx, DatagramPacket msg, List<Object> out) throws Exception { msg.retain(); out.add(msg.content()); } }); ch.pipeline().addLast(new XmlFrameDecoder(2147483647)); ch.pipeline().addLast(new XmlEventProcessor(eventIpcManager)); } }); future = b.bind(config.getUDPIpAddress(), config.getUDPPort()).await(); }