• Post Reply Bookmark Topic Watch Topic
  • New Topic

send data to all clients  RSS feed

 
Madhan Kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am currently working on a java chat application.i have decided to use Socket for this purpose.Now, my question is how do i send data to all the clients who are connected. Is there any method that can be used for this purpose ? If so please let me know, i am stuck here... Thanks in advance
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your client - server protocol like? I've used something where the client does connect-send-disconnect to send to the server, and holds a ServerSocket open to accept messages from the server. In that structure the server can iterate a list of clients to get address:port, then do the connect-send-disconnect bit to each client. Did that make sense?
[ October 03, 2006: Message edited by: Stan James ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!