//Generic internal send function | //Generic internal send function | ||||
Socket.prototype._send = function(data) { | Socket.prototype._send = function(data) { | ||||
this._websock.send(JSON.stringify(data)); | |||||
if (this._ready) | |||||
this._websock.send(JSON.stringify(data)); | |||||
} | } | ||||
//Trigger event on the client | //Trigger event on the client |
{ | { | ||||
"name": "socksugar", | "name": "socksugar", | ||||
"version": "0.3.1", | |||||
"version": "0.3.2", | |||||
"description": "Websockets with sugar on top.", | "description": "Websockets with sugar on top.", | ||||
"main": "index.js", | "main": "index.js", | ||||
"scripts": { | "scripts": { |