users@glassfish.java.net

Re: GF 3.1.1 WebSocket support - cannot enable WebSockets

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Fri, 20 Jan 2012 16:19:32 -0800

On 1/20/12 8:01 AM, forums_at_java.net wrote:
> hey,
>
> i implemented your suggestions to my code: changed the libraries,
> updated my
> classes and set the load-on-startup "flag" in web.xml (i know, gf3
> supports
> servlet 3.0) and it WORKS!!!
>
> thank you very, very much for your great help! :D
>
> But i still have one question:
>
> In jetty: if a request arrives, the servlet delegates the request to the
> doWebSocketConnect()-Method. If there are many requests, every new
> request
> get its instiated class (alias serversocket)
>
> How is that in glassfish?
>
> Every time a request arrive, the servlet delegate the request to
> "conn"-Object, which on his part executes the "createWebSocket"-Method
> and
> create a Websocket for this specific request. If there are more than one
> request, is this method responsible to create a websocket (server side
> socket) for every request?
It will create a new WebSocket for each distinct upgrade request.
>
> if the socket aswers, it delegates the events to the "conn"-Object
> (onMessage
> etc.). So if there are multiple requests, are the onMessage, onOpen etc.
> Methods threadsafe?
>
> For Example:
>
> Client 1 sends a request
>
> Client 2 sens a request (at the same time)
>
> conn creates a websocket for C1
>
> (the same?) conn creates a websocket for C2
>
> Do both sockets use the same onOpen, onMessage Methods or do they have
> their
> own methods?
Each socket instance is separate.
>
> i hope, you understand my question /issue ;)
>
>
>
> best regards
>
> hsch
>
>
> --
>
> [Message sent by forum member 'hsch']
>
> View Post: http://forums.java.net/node/882757
>
>