ws error on send

When sending through a ws socket you might get an error saying that the socket is not open.
by adding an empty callback to `ws.send`  this seems to fixe it
This commit is contained in:
Stefdv
2016-09-17 22:56:31 +02:00
committed by GitHub
parent 5b201d64f2
commit aff0720e69

4
gun.js
View File

@@ -1350,7 +1350,7 @@
if(res.body || res.end){ delete r.ws.cbs[req.headers['ws-rid']] }
cb(err,res);
}
ws.send(JSON.stringify(req));
ws.send(JSON.stringify(req),function(err) { // that's all })
return true;
}
if(ws === false){ return }
@@ -1474,4 +1474,4 @@
}());
if(typeof window !== "undefined"){ Gun.request = request }
if(typeof module !== "undefined" && module.exports){ module.exports.request = request }
}.bind(this || module)({}));
}.bind(this || module)({}));