Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/paho-mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1574,10 +1574,12 @@ function onMessageArrived(message) {
// Cancel all socket callbacks so that they cannot be driven again by this socket.
this.socket.onopen = null;
this.socket.onmessage = null;
this.socket.onerror = null;
this.socket.onclose = null;
if (this.socket.readyState === 1)
if (this.socket.readyState <= 1) {
this.socket.onerror = () => {};
this.socket.close();
}
this.socket.onerror = null;
delete this.socket;
}

Expand Down