In what cases will a websocket close event tell you wasClean is false? For example:
connection.onclose = function(event) {
if(!event.wasClean) {
// whyyyyyyy???
}
}
wasClean property is set to false when the WebSocket connection did not close via the close handshake.
i.e. by not receiving a valid Close frame from the server.
And from documentation: "CloseEvent.wasClean Returns a Boolean that Indicates whether or not the connection was cleanly closed"
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