@nxtedition/deepstream.io-client-js 24.1.10 → 24.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -9,8 +9,6 @@ const xxhash = require('xxhash-wasm')
|
|
|
9
9
|
const FixedQueue = require('../utils/fixed-queue')
|
|
10
10
|
const Emitter = require('component-emitter2')
|
|
11
11
|
|
|
12
|
-
const kCorked = Symbol('corked')
|
|
13
|
-
|
|
14
12
|
const Connection = function (client, url, options) {
|
|
15
13
|
this._client = client
|
|
16
14
|
this._options = options
|
|
@@ -108,6 +106,7 @@ Connection.prototype._createEndpoint = function () {
|
|
|
108
106
|
: new NodeWebSocket(this._url, {
|
|
109
107
|
generateMask() {},
|
|
110
108
|
})
|
|
109
|
+
this._corked = false
|
|
111
110
|
|
|
112
111
|
this._endpoint.onopen = this._onOpen.bind(this)
|
|
113
112
|
this._endpoint.onerror = this._onError.bind(this)
|
|
@@ -138,12 +137,12 @@ Connection.prototype.send = function (message) {
|
|
|
138
137
|
return false
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
if (this._endpoint._socket && !this.
|
|
140
|
+
if (this._endpoint._socket && !this._corked) {
|
|
142
141
|
this._endpoint._socket.cork()
|
|
143
|
-
this.
|
|
142
|
+
this._corked = true
|
|
144
143
|
setImmediate(() => {
|
|
145
|
-
this._endpoint[kCorked] = false
|
|
146
144
|
this._endpoint._socket.uncork()
|
|
145
|
+
this._corked = false
|
|
147
146
|
})
|
|
148
147
|
}
|
|
149
148
|
|