help on java multicast!!

hi !!I am working on a group chat and having a problem with multicasting the message to all the sockets ...how to create a stream for each of the sockets?plz help me i have very little time ..
[206 byte] By [vdga] at [2007-11-27 7:40:58]
# 1
sorry i forgot to add one thing i am not using datagram packets i want it to be in tcp since it is more reliable,,,,
vdga at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...
# 2
(a) There is no such thing as multicast over TCP.(b) TCP sockets already have streams.So what is the problem exactly?
ejpa at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...
# 3
thnx for reply...wat i wanted to covey was a message entered by a client should be sent to all the clients who r connected to the server..plz reply
vdga at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...
# 4
I've already answered the questions you asked, what's the problem now?
ejpa at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...
# 5
No dude i know they have streams but where to store the corresponding socket and its stream so that i can write to that particular socket using the same stream?Do i need to use a vector or a hashtable?
vdga at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...
# 6
We were supposed to guess that?Getting a bit sick of this guessing game. This is Data Structures 101 and you haven't provided enough information to solve it, not that you should need any help frankly.
ejpa at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...
# 7

Hi,

First of all, are you sure you have enough knowledge to build such application? are you sure you don't need to check some tutorials first?

I have read some books on networking / sockets and java in general and still do not feel I have all the required knowledge to answer this post. However this is my quess.

Personally I think that your socket connection should be wrapped in some type of handler object. These handler objects should then be stored in some type of collection (like a pool). The when you need to send a message all you have to do is loop in this collection and send the message to each client connection!!

Regards,

Sim085

sim085a at 2007-7-12 19:21:31 > top of Java-index,Core,Core APIs...