Created
November 4, 2014 22:05
-
-
Save tsegismont/d43d68ef1320df8e5f67 to your computer and use it in GitHub Desktop.
netty-collectd bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| group = new NioEventLoopGroup(); | |
| bootstrap = new Bootstrap(); | |
| bootstrap.group(group).channel(NioDatagramChannel.class).handler(new ChannelInitializer<Channel>() { | |
| @Override | |
| protected void initChannel(Channel channel) throws Exception { | |
| ChannelPipeline pipeline = channel.pipeline(); | |
| pipeline.addLast(new CollectdPartsDecoder()); // Add CollectdPartsDecoder first | |
| pipeline.addLast(new CollectdEventsDecoder()); // Then CollectdEventsDecoder | |
| pipeline.addLast(new MyCollectdEventHandler()); // Consume events in your own handler | |
| } | |
| }).localAddress(address); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment