Skip to content

Commit

Permalink
[api] Added 'connect' and 'close' events on the godot client for thei…
Browse files Browse the repository at this point in the history
…r respective functions
  • Loading branch information
jcrugzz committed May 4, 2013
1 parent 189d4eb commit 2fbe2f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/godot/net/client.js
Expand Up @@ -48,6 +48,10 @@ var Client = module.exports = function Client(options) {
});
}
};

//
// Inherit from EventEmitter
//
util.inherits(Client, EventEmitter);

//
Expand Down Expand Up @@ -194,6 +198,7 @@ Client.prototype.connect = function (port, host, callback) {
if (connectBackoff) {
connectBackoff.reset();
}
return self.emit('connect');
});
}

Expand Down Expand Up @@ -234,4 +239,6 @@ Client.prototype.close = function () {
Object.keys(this.producers).forEach(function (id) {
self.remove(self.producers[id]);
});

return this.emit('close');
};
2 changes: 1 addition & 1 deletion lib/godot/net/index.js
Expand Up @@ -6,4 +6,4 @@
*/

exports.Server = require('./server');
exports.Client = require('./client');
exports.Client = require('./client');

0 comments on commit 2fbe2f5

Please sign in to comment.