users@grizzly.java.net

websocket question #2

From: <rama.rama_at_tiscali.it>
Date: Thu, 2 Feb 2012 17:38:47 +0100 (CET)

Hi there,


i have take a moment to review web socket class and i have
some more question :)


the biggest issue that i am facing is how to
associate a socket to a certain user

for istacence i have to detect
who (user) is sending this message.
public void onMessage(com.sun.
grizzly.websockets.WebSocket socket, java.lang.String text) {

}

what
can be possible is to add into an hash map something like Map<WebSocket,
User>

but, on this method
   public boolean isApplicationRequest
(Request request) {
       return true;
    }

where i can found the
user (using cookies) i don't know how to get the web socket (probably
because the
websocket isn't connected yet)



so, to make it easy
1.
is possible to get the web socket on isApplicationRequest method? (imho
no, web socket isn't yet created)
2. is possible to get the header of
the request that create a web socket on "onMessage" method?
in that way
i can always re-fetch the user in a very easy way


warm regards!



E' nata indoona: chiama, videochiama e messaggia Gratis. Scarica indoona per iPhone, Android e PC: http://www.indoona.com/