atmosphere
atmosphere copied to clipboard
Websocket connection doesnt close with firefox
When u create a websocket connection with firefox and click several times on F5, u can see that firefox creates multiple websocket connections. This could be related to expected close frame or something from the server.
Easy to reproduce with Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/17.0 Firefox/17.0 and atmosphere runtime 1.0.4
In chrome it works fine. dono about other browsers.
You can avoid that by attaching the beforeunload event.
$(window).on("beforeunload", function() {
atmosphere.unsubscribe();
});
For details, see the 3rd one at https://github.com/flowersinthesand/portal/wiki/Browser-Quirks