You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried a scenario where I managed multiple request resources from the client. To be able to unsubscribe a specific request, I had to use unsubscribeUrl because unsubscribe would close both requests.
During these tests, I observed that unsubscribe had
if (rq.enableProtocol()) {
jQuery.ajax({url: rq.getUrl() + "?X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=" + rq.getUUID(), async:false});
}
while unsubscribeUrl had no such close call.
The server detected connection close if I used unsubscribe, but not if I used unsubscribeUrl. The server would also detect connection close if I simply closed the browser.
I've tested with the same addition to unsubscribeUrl and it works well.
The X-Atmosphere-Transport=close request sent to my servlet can not be used to remove resource from broadcaster. While the uuid is the same, the request object received in the servlet is not. Calling broadcaster.removeAtmosphereResource(resource) will try to remove a matching object and since the object can't be found nothing is removed. if i iterate through broadcaster.getAtmosphereResources(), match the uuids and call broadcaster.removeAtmosphereResource(resource) on the resource found everything works as expected.
Setup:
Atmosphere 1.0.10
Jetty 8.1
Based on atmosphere-atmospherehandler-pubsub
request.enableProtocol=true
Broadcaster: DefaultBroadcaster
Cache: UUIDBroadcasterCache
Regards,
Øyvind
The text was updated successfully, but these errors were encountered:
my idea here was to not send the close protocol because it would tell Atmosphere that the client has completely disappeared. But I kind of agree with you it would be useful to have such mechanism. So I will add support in 1.1 as I don't know yet if I will release a 1.0.12. As a workaround, you can implement the mechanism inside the onClose function by calling
Any thoughts about not being able to remove the AtmosphereResource from the broadcaster during the X-Atmosphere-Transport=close request without iterating though them all and mathing uuids?
Hi,
Regarding unsubscribeUrl in https://github.com/Atmosphere/atmosphere/blob/atmosphere-1.0.x/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js
I tried a scenario where I managed multiple request resources from the client. To be able to unsubscribe a specific request, I had to use unsubscribeUrl because unsubscribe would close both requests.
During these tests, I observed that unsubscribe had
if (rq.enableProtocol()) {
jQuery.ajax({url: rq.getUrl() + "?X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=" + rq.getUUID(), async:false});
}
while unsubscribeUrl had no such close call.
The server detected connection close if I used unsubscribe, but not if I used unsubscribeUrl. The server would also detect connection close if I simply closed the browser.
I've tested with the same addition to unsubscribeUrl and it works well.
The X-Atmosphere-Transport=close request sent to my servlet can not be used to remove resource from broadcaster. While the uuid is the same, the request object received in the servlet is not. Calling broadcaster.removeAtmosphereResource(resource) will try to remove a matching object and since the object can't be found nothing is removed. if i iterate through broadcaster.getAtmosphereResources(), match the uuids and call broadcaster.removeAtmosphereResource(resource) on the resource found everything works as expected.
Setup:
Regards,
Øyvind
The text was updated successfully, but these errors were encountered: