File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to implement multicasting in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to implement multicasting in java?" Watch "how to implement multicasting in java?" New topic
Author

how to implement multicasting in java?

Kavita Shivani
Ranch Hand

Joined: Aug 14, 2009
Posts: 44
Hi everyone,
I am supposed to create a small multicast application. Multicasting is a new topic for me.
The requirement is that, I have a multicast server, few clients connected to it who are interested in some of the topics that the server multicasts. Each one of this client can register themselves to get information on each of the topics, using the topic ID. So I wanted to know if I can group these clients into one multicast address group and send the packets. If I do this, I will have to use a few InetAddresses, each representing a group address to which subset of the clients will register to. But this will increase as the number of topics increase. So my question is am I doing it the right way? Or is it that my multicast server will always have one multicast group address and I need to have a proper logic to seggregate the clients that wants to receive the information on topics they are interested in. I am not sure how do I design this.

Thank you,
Kavitha.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9939
    
    6

search around for the Publish/Subscribe design pattern. it may help guide you in your design.


Never ascribe to malice that which can be adequately explained by stupidity.
Rok Ć telcer
Ranch Hand

Joined: Nov 03, 2009
Posts: 101
fred rosenberger wrote:search around for the Publish/Subscribe design pattern. it may help guide you in your design.

Or in other words: Observer pattern.

Regards,
Rok


SCJP, SCWCD
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1403

Have you looked at JMS yet? Seems to me that a standard multicast JMS solution using topics would suit your needs pretty well.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: how to implement multicasting in java?
 
Similar Threads
Chat Server Design?
clustering
Can MDB listen to multiple topics
some java interview Questions
Unable to join multicast group