diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-12-23 01:40:28 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-12-30 12:35:11 +0300 |
commit | 4e81cf7def7c672b620086323c34010d2718e697 (patch) | |
tree | 41e0ba09186d22b156ce654037ec3023a813ef7b /lib | |
parent | a8417c128e0c871c6af03236fa42209dc1977caa (diff) |
Debugger client emits ready after recving initial res
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_debugger.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js index 72af3a5cbc4..25f82e72e1f 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -19,7 +19,8 @@ function tryConnect() { c = new Client(); process.stdout.write("connecting..."); - c.connect(exports.port, function () { + c.connect(exports.port); + c.on('ready', function () { process.stdout.write("ok\r\n"); startInterface(); }); @@ -141,6 +142,7 @@ Client.prototype._onResponse = function(res) { if (res.headers.Type == 'connect') { // do nothing + this.emit('ready'); } else if (cb) { this._reqCallbacks.splice(i, 1); cb(res.body); |