Skip to content

Instantly share code, notes, and snippets.

@yongboy
Created May 26, 2014 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yongboy/260285205c3898554f5c to your computer and use it in GitHub Desktop.
Save yongboy/260285205c3898554f5c to your computer and use it in GitHub Desktop.
public class TcpChannelInitializer extends ChannelInitializer<SocketChannel> {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(
new MqttMessageNewEncoder(),
new MqttMessageNewDecoder(),
new MqttMessageHandler());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment