-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
each request from the same client returns a different AtmosphereResource #488
Comments
The only issue I see what that approach is the AtmosphereResource has a reference to an AtmosphereRequest. The AtmosphereResource will needs to be updated on every new message with a new AtmosphereRequest instance (so you can read the message body). Looking.... |
A better solution would be to send the AtmosphereResource UUID to the On 7-7-2012 16:13, poi212003 wrote:
|
@pierreh That would implies a new protocol where some information are sent back to the client after the handshake and as a WebSocket message. This is doable, but I prefer not to change anything for now. @poi212003 Fixed, just retrieve the following attribute form any AtmosphereRequest org.atmosphere.cpr.AtmosphereResource.webSocket.handshake and the use the AtmosphereResourceFactory to retrieve the original AtmosphereResource. |
working great!! |
a small bug - this attribute is not passed to the events (for example in the disconnect event I can't get it - it's always null) |
Can you elaborate? On which Request are you setting the attribute? The first one? |
I'm trying to get the uuid of the original request by getting this attribute: When the user performs POST on the websocket, I'm able to get this attribute and retrieve the original resource, @OverRide Hope that's clear |
did you get to test it? |
@poi212003 Yes, and also responded on the mailing list. I do have a test case that works as well. |
ok - it looks like something else is messing it up - after I create a websocket then I refresh the page a new websocket it automatically created (I'm not doing anything at this point on the client side) and then the disconnect gets the uuid of the new websocket. Can I control this? i dont want it to open a websocket automatically. |
tested on firefox |
@poi212003 Let's use the mailing list for questions :-) You just need to implement the onReconnect(request,response) function and close the request so no re-connect. Take a look at this |
works like a charm! :) Thanks. |
tested on tomcat 7.0.28 64bit
windows xp/7 64bit
atmosphere 1.0.0.beta2a (0.9.4 as well)
spring 2.5.4 (spring 3 tested and got the same result)
current work around - save the resource in a map on creation of the websocket and then we can access it later on.
To my knowledge the resource should be same for each POST from the same client (in other words it should persist per client).
The text was updated successfully, but these errors were encountered: