XClient.terminate

This commit is contained in:
Andrey Sidorov 2011-07-19 09:31:47 +10:00
parent 7de07994a5
commit 359c8205ef
2 changed files with 10 additions and 2 deletions

View file

@ -76,6 +76,12 @@ function XClient(stream)
}
util.inherits(XClient, EventEmitter);
// TODO: close() = set 'closing' flag, watch it in replies and writeQueue, terminate if empty
XClient.prototype.terminate = function()
{
this.stream.end();
}
XClient.prototype.importRequestsFromTemplates = function(target, reqs)
{
var client = this;

View file

@ -2,7 +2,9 @@ var x11 = require('../lib/x11');
var X = x11.createClient();
X.on('connect', function(display) {
X.ListExtensions(function(list) {
console.log(list);
X.close();
list.forEach(function(ext) {
console.log(ext);
});
X.terminate();
});
});