users@grizzly.java.net

Best Practice to broadcast / send private messages to client(s)

From: Ken--_at_newsgroupstats.hk <dragonken_at_gmail.com>
Date: Sun, 17 Aug 2008 20:47:34 -0700 (PDT)

In the past with plain java.nio or old java.io. I used a HashMap to store a
list of java.net.Socket/InputStream/OutputStream of logined client.

Whenever I want to broadcast / send private message to client(s), I use:

Vector vtClient = Clients.getAllClients(); // or Clients.getClientById(id);
for() {
(Client)vtClient.elementAt(i).getOutputStream().write(messages);
}

So, how to do it in grizzly? I know I can do it with my own method easily
but I want to know that best practice.

Thanks and Regards,
Ken






-- 
View this message in context: http://www.nabble.com/Best-Practice-to-broadcast---send-private-messages-to-client%28s%29-tp19025702p19025702.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.