| 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
|
|
|
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.
|
 |
 |
|
|
subject: how to implement multicasting in java?
|
|
|