src: migrate pthreads to uv_threads
- So it can be compatible in every platform supported by libuv. - Use attached threads instead of detached. - Remove all CardReader 'status' listeners before emitting the 'end' event.
This commit is contained in:
@@ -59,6 +59,11 @@ module.exports = function() {
|
||||
r.state = state;
|
||||
});
|
||||
|
||||
r.on('_end', function() {
|
||||
r.removeAllListeners('status');
|
||||
r.emit('end');
|
||||
});
|
||||
|
||||
p.emit('reader', r);
|
||||
});
|
||||
});
|
||||
@@ -102,7 +107,6 @@ CardReader.prototype.disconnect = function(disposition, cb) {
|
||||
};
|
||||
|
||||
CardReader.prototype.transmit = function(data, res_len, protocol, cb) {
|
||||
|
||||
if (!this.connected) {
|
||||
return cb(new Error("Card Reader not connected"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user