atmosphere icon indicating copy to clipboard operation
atmosphere copied to clipboard

Websocket connection doesnt close with firefox

Open hapali opened this issue 13 years ago • 1 comments

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.

hapali avatar Dec 06 '12 10:12 hapali

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

flowersinthesand avatar Dec 06 '12 13:12 flowersinthesand