MQTT.js icon indicating copy to clipboard operation
MQTT.js copied to clipboard

fix(browser): prevent error stream.push() after EOF

Open sanduluca opened this issue 5 months ago • 5 comments

check if the stream is still open and writable before pushing data.

Also I was wondering if a Event Listener Cleanup should be made ? I dont see any removeEventListener to prevent any further callbacks from firing after closure:

    socket.removeEventListener('close', onClose);
    socket.removeEventListener('error', onError);
    socket.removeEventListener('message', onMessage);
    socket.removeEventListener('open', onOpen);

Fixes #1914

sanduluca avatar Aug 30 '24 14:08 sanduluca