In Netty if I create multiple ConnectionlessBootstrap instances and then set the ChannelPipeline on them using code like udpBootstrap.setPipeline(pipelineFactory.getPipeline());
Will the DatagramChannel‘s created using following code:-
DatagramChannel datagramChannel = (DatagramChannel) udpBootstrap
.bind(new InetSocketAddress(host, 0));
have the appropriate decoders and encoders in its pipeline based on the factory? Or irrespective of the bootstrap/pipelinefactory, DatagramChannel‘s can have only one associated pipeline.
Scenario is that I want to use UDP to decode/encode different network protocols.
If you set the ChannelPipeline directly then they will share the same ChannelPipeline contents. If you want a different one per Channel you should set the ChannelPipelineFactory.