mirror of
https://github.com/danbulant/node-x11
synced 2026-05-21 21:39:13 +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);
|
||||
|
||||
// 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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue