UDP Listener

이희승 (Trustin Lee) trustin at gmail.com
Thu Aug 11 23:00:28 EDT 2011


Could you also post the non-Netty code that works? I also would suggest you to remove the decoder from the pipeline just in case of the buggy decoder.

-- 
Trustin Lee (http://gleamynode.net/)

On Thursday, August 11, 2011 at 10:50 PM, alex_ab_sw wrote:

> Hello,
> 
> I am trying to write a component in an application that will listen on UDP
> for multicast messages, but somehow I don't receive any messages while with
> a MulticastSocket I can see the messages landing fine.
> 
> Here is the piece of code that I am talking about:
> ---------------------------------------------------------------
>  DatagramChannelFactory channelFactory = new
> OioDatagramChannelFactory(Executors.newCachedThreadPool());
>  ConnectionlessBootstrap bootstrap = new
> ConnectionlessBootstrap(channelFactory);
> 
>  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
>  @Override
>  public ChannelPipeline getPipeline() {
>  return Channels.pipeline(messageDecoder, multicastHandler);
>  }
>  });
> 
>  bootstrap.setOption("receiveBufferSizePredictorFactory", new
> FixedReceiveBufferSizePredictorFactory(
>  maxPacketSize));
> 
> 
> logger.info (http://logger.info)("... binding the DatagramChannel on new
> InetSocketAddress {}:{}", localIpAddress, multicastPort);
>  DatagramChannel datagramChannel = (DatagramChannel)
>  bootstrap.bind(new InetSocketAddress(localIpAddress,
> multicastPort));
> 
>  try {
>  InetAddress multicastAddress =
> InetAddress.getByName(multicastIpAddress);
>  datagramChannel.joinGroup(multicastAddress);
>  } catch (UnknownHostException e) {
>  shutdown();
>  }
> ------------------------------------------------------------
> Can you tell if I am doing something wrong, because I see no errors on logs
> but also no messages coming. The component is deployed on a Linux box with
> CentOS on it.
> 
> Thanks in advance.
> 
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/UDP-Listener-tp6676456p6676456.html
> Sent from the Netty User Group mailing list archive at Nabble.com (http://Nabble.com).
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org (mailto:netty-users at lists.jboss.org)
> https://lists.jboss.org/mailman/listinfo/netty-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110812/2ac80425/attachment.html 


More information about the netty-users mailing list