Merge pull request #125 from Arteris/handshake_error

Unpack handshake error
This commit is contained in:
Andrey Sidorov 2016-05-19 12:08:39 +10:00
commit 88370a111e

View file

@ -116,9 +116,14 @@ bl.unpack('C', function(res) {
if (res[0] == 0)
{
// conection time error
// unpack error (? TODO)
var err = new Error;
cb(err); // TODO: detect that this is error on xcore side
// unpack error
bl.unpack('Cxxxxxx', function (rlen) {
bl.get(rlen[0], function (reason) {
var err = new Error;
err.message = 'X server connection failed: ' + reason.toString();
cb(err);
});
});
// TODO: do we need to close stream from our side?
// TODO: api to close source stream via attached unpackstream
return;