These are chat archives for santigimeno/node-pcsclite

25th
Apr 2017
Martin Paljak
@martinpaljak
Apr 25 07:13
Hello!
I am a bit confused about reader.close() and pcsc.close() and how to cleanly shut down an application after I am done with the reader I was interested in.
Like. Do I have to call reader.close() after disconnect() ? Both reader.close() and pcsc.close() ?
Then regarding the documentation, it is unclear to me why both call SCardCancel. Are there separate calls? AFAIU only one SCardGetSTatusChange is sufficient to get events for existing and pnp readers.
anyway, calling both is not enough, firstly I get a PCSC error SCardGetStatusChange error: Command cancelled.(0x80100002) when calling pcsc.close()
Martin Paljak
@martinpaljak
Apr 25 07:18
wherever that happens, it should be expected, IMHO SCARD_CANCELLED should never trigger a pcsc error, as that is expected behavior ?
and finally, I still need to call process.exit to quit the app.
after calling reader.close() and pcsc.close()
And thanks for an otherwise charming library, works flawlessly on linux/osx for my needs (other than the clean shutdown issu) :)
Martin Paljak
@martinpaljak
Apr 25 07:24
Once I can resolve the shutdown issue, I have a feature request, regarding transactions (and careful with those on Windows, due to the "5 second rule")
Sometimes an exclusive connection is not available/possible, but reliablity should be assured as much as possible (no interference from other applications) thus I would like to propose an argument to SCardConnect wrapper for non-windows machines, where a transaction would be set on the reader after connect, if specified so in options
(looking at gitter activity it seems to be as heavily used as ... not at all. I will file issues as well, for better tracking)
Martin Paljak
@martinpaljak
Apr 25 08:15
checkdone.
Santiago Gimeno
@santigimeno
Apr 25 10:13
@martinpaljak hey
would love to have code that reproduces the error, I've fixed similar errors in the past :)
WRT to transactions, would you be up to implementing them? I'm no already using them but would gladly accept PR :)
thanks!