We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffc54dc commit a619abaCopy full SHA for a619aba
src/transports/websocket.js
@@ -31,8 +31,12 @@ module.exports = class Connection extends EventEmitter {
31
this.debugOut('writeLine() socket=' + (this.socket ? 'yes' : 'no') + ' connected=' + this.connected);
32
33
if (this.socket && this.connected) {
34
- this.socket.send(line, cb);
35
- } else if (cb) {
+ this.socket.send(line);
+ }
36
+
37
+ // Websocket.send() does not support callbacks
38
+ // call the callback in the next tick instead
39
+ if (cb) {
40
setTimeout(cb, 0);
41
}
42
0 commit comments