mardi 30 décembre 2014

WebSockets Chat Application,access the live single sessions

I am Developing Chatting website,apps using Web WebSockets



import javax.websocket.OnClose;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;


Used This Libary.
All Live Session store in this object
private static final Set<Session> sessions = Collections.synchronizedSet(new HashSet<Session>());
Now Question is
for (Session s : sessions)
{
}



  1. This way access all recode ,Now I am traying access single session s Sessions[2];

  2. This Way I am Not access Single socket Another Que is Websocket is Proper Way For Chatting,and They How Many Users Handle. I get code from Below link enter link description here





Aucun commentaire:

Enregistrer un commentaire