users@glassfish.java.net

Re: GF 3.1.1 WebSocket support - cannot enable WebSockets

From: <forums_at_java.net>
Date: Fri, 20 Jan 2012 10:01:56 -0600 (CST)

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?

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?

i hope, you understand my question /issue ;)

 

best regards

hsch


--
[Message sent by forum member 'hsch']
View Post: http://forums.java.net/node/882757