Check readyState against constant WebSocket.OPEN

This commit is contained in:
Drew DeVault 2015-07-30 11:37:00 -04:00
parent bdda61fc73
commit 5122a8a4ce
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ function Websock() {
}
if (this._websocket.bufferedAmount < this.maxBufferedAmount) {
if (this._sQ.length > 0 && this._websocket.readyState === 1) {
if (this._sQ.length > 0 && this._websocket.readyState === WebSocket.OPEN) {
this._websocket.send(this._encode_message());
this._sQ = [];
}