diff --git a/include/websock.js b/include/websock.js index f3336a0a..4d7a4f9a 100644 --- a/include/websock.js +++ b/include/websock.js @@ -197,7 +197,7 @@ function Websock() { } if (this._websocket.bufferedAmount < this.maxBufferedAmount) { - if (this._sQlen > 0) { + if (this._sQlen > 0 && this._websocket.readyState === WebSocket.OPEN) { this._websocket.send(this._encode_message()); this._sQlen = 0; }