@nxtedition/deepstream.io-client-js 24.1.7 → 24.1.9
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,6 +9,8 @@ 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
|
+
|
|
12
14
|
const Connection = function (client, url, options) {
|
|
13
15
|
this._client = client
|
|
14
16
|
this._options = options
|
|
@@ -136,9 +138,11 @@ Connection.prototype.send = function (message) {
|
|
|
136
138
|
return false
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
if (this._endpoint._socket && !this._endpoint
|
|
141
|
+
if (this._endpoint._socket && !this._endpoint[kCorked]) {
|
|
140
142
|
this._endpoint._socket.cork()
|
|
141
|
-
|
|
143
|
+
this._endpoint[kCorked] = true
|
|
144
|
+
setImmediate(() => {
|
|
145
|
+
this._endpoint[kCorked] = false
|
|
142
146
|
this._endpoint._socket.uncork()
|
|
143
147
|
})
|
|
144
148
|
}
|