Merge 5122a8a4ce into 8f3c0f6b9b
This commit is contained in:
commit
2a78f80d1a
|
|
@ -175,7 +175,7 @@ function Websock() {
|
|||
}
|
||||
|
||||
if (this._websocket.bufferedAmount < this.maxBufferedAmount) {
|
||||
if (this._sQ.length > 0) {
|
||||
if (this._sQ.length > 0 && this._websocket.readyState === WebSocket.OPEN) {
|
||||
this._websocket.send(this._encode_message());
|
||||
this._sQ = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ describe('Websock', function() {
|
|||
it('should actually send on the websocket if the websocket does not have too much buffered', function () {
|
||||
sock.maxBufferedAmount = 10;
|
||||
sock._websocket.bufferedAmount = 8;
|
||||
sock._websocket.readyState = 1;
|
||||
sock._sQ = [1, 2, 3];
|
||||
var encoded = sock._encode_message();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue