@@ -26,7 +26,7 @@ | |||
"or typing <code>send</code> in the server's console."; | |||
//Listen to 'myEvent', which the server emits when you | |||
//type 'say' in its console | |||
//type 'send' in its console | |||
sock.on("myEvent", function(data) { | |||
console.log("Received myEvent from server!"); | |||
console.log(data); |
@@ -40,11 +40,18 @@ var util = require("util"); | |||
//Socket { | |||
function Socket(websock) { | |||
this._websock = websock; | |||
this._ready = false; | |||
websock.on("close", function() { | |||
this._ready = false; | |||
this.emit("close"); | |||
}.bind(this)); | |||
websock.on("ready", function() { | |||
this._ready = true; | |||
this.emit("ready"); | |||
}); | |||
websock.on("message", function(msg) { | |||
var obj; | |||
try { |
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "socksugar", | |||
"version": "0.3.0", | |||
"version": "0.3.1", | |||
"description": "Websockets with sugar on top.", | |||
"main": "index.js", | |||
"scripts": { |