mirror of
https://github.com/danbulant/node-x11
synced 2026-05-24 12:35:39 +00:00
XClient.terminate
This commit is contained in:
parent
7de07994a5
commit
359c8205ef
2 changed files with 10 additions and 2 deletions
|
|
@ -76,6 +76,12 @@ function XClient(stream)
|
||||||
}
|
}
|
||||||
util.inherits(XClient, EventEmitter);
|
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)
|
XClient.prototype.importRequestsFromTemplates = function(target, reqs)
|
||||||
{
|
{
|
||||||
var client = this;
|
var client = this;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ var x11 = require('../lib/x11');
|
||||||
var X = x11.createClient();
|
var X = x11.createClient();
|
||||||
X.on('connect', function(display) {
|
X.on('connect', function(display) {
|
||||||
X.ListExtensions(function(list) {
|
X.ListExtensions(function(list) {
|
||||||
console.log(list);
|
list.forEach(function(ext) {
|
||||||
X.close();
|
console.log(ext);
|
||||||
|
});
|
||||||
|
X.terminate();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue