We have a code that creates multiple websocket instances every time the application is opened.
privateMembers.webSocket = new WebSocket(url, protocol);
where the url contains an authentication token. And these instances are closed when the app is closed/unload. The application is embedded (iframe) to another application when the issue is observed.
We noticed that a SecurityError exception is logged on the browser's console. And when this happens, the number of websockets being created on the next initialization is reduced. For example, we are creating 5 websocket instances, on next launch of the iframe, it will create only 4 instances and this exception is logged. We are clearing the count and the array every time we unload the application.
Also, this only happens on latest versions of IE 11 and Edge.
IE 11 has a limit of 6 websocket instances per host. And it seems on the latest version of IE 11 (11.xxx), there seems to be an update on how these instances are being handled.
If we close an iframe that has websocket connections and not trigger the onclose on these instances, these instances still remains but without any reference (dangling).
And to fix our issue, we had to go through all of these websocket instances and make sure that all of them are closed when we close the iframe. The decreasing number of instances created is due to unclosed websocket instance.
We still haven't found any documentation regarding this on the latest IE 11 versions. And if anyone can provide this, it would really be great and much appreciated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With