is Netty is able to do UDP Broadcast ? (MulticastSocket)

"이희승 (Trustin Lee)" trustin at gmail.com
Tue Aug 11 22:47:39 EDT 2009


>> #1 - Send a UDP message using MulticastSocket and close the socket.

Yes.

>> #2 - Send a UDP message using DatagramSocket but wait for a
>> response
>> (wait until TTL)
>> #3 - Listen for UDP message using MulticastSocket (while(true))

Netty is event-driven.  There's no direct support for 'wait for a new
message'.  You are given with a handler interface and Netty will call
the handler method when you receive a message.  You can implement
'blocking read' with some java.util.concurrent constructs though.

However, I think writing an out-of-the-box handler that implements
'blocking read' is a great idea:

  * https://jira.jboss.org/jira/browse/NETTY-208

Trustin


On 08/11/2009 10:46 PM, Iain McGinniss wrote:
> I think you should be able to cover all cases using the  
> OioDatagramChannelFactory, and if case 2 is unicast, you can do that  
> using a NioDatagramChannelFactory. NioDatagramChannelFactory doesn't  
> support multicast in 3.1.0 GA, this is listed as a limitation in the  
> javadocs.
> 
> Iain
> 
> On 11 Aug 2009, at 14:38, Survivant 00 wrote:
> 
>> I'm looking to validate if Netty is able to do Broadcasting UDP.  I  
>> looked other frameworks and JGroups can't do the job, Mina don't  
>> plan that until 3.0 and Grizzly.. works in progress.
>>
>> Does Netty do that ?
>>
>> I have 3 cases.
>>
>> #1 - Send a UDP message using MulticastSocket and close the socket.
>> #2 - Send a UDP message using DatagramSocket but wait for a response  
>> (wait until TTL)
>> #3 - Listen for UDP message using MulticastSocket (while(true))
>>
>> I want to migrate that to Netty, but I didn't find a sample for  
>> that :(
>>
>>
>> _______________________________________________
>> netty-users mailing list
>> netty-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/netty-users
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users



More information about the netty-users mailing list