[Pcsclite-muscle] Asynchronous PCSC API

Ievgenii Meshcheriakov ievgenii.meshcheriakov at qt.io
Wed Jan 26 01:54:35 PST 2022


вівторок, 25 січня 2022 р. 17:39:34 CET Ludovic Rousseau написано:
> Good to know.
> Maybe I should implement a similar behaviour in pcsc-lite.
> You are the first one to request this feature.
I really want to be able to make an asynchronous API for using PCSC. And 
SCardCancel is unfortunately the closest thing that is available.

> How do you plan to use this new behaviour?
> thread A: SCardConnect()
> thread B: wait a bit
> thread B: SCardCancel() to unblock SCardConnect() in thread A
> 
> Then, what to do after that?
> Try again to connect until it succeeds?
> Something else?
I didn't implement anything yet, but the idea is that there are worker threads 
that handle connections to cards. It's fine if SCardConnect is blocking there, 
but it should be possible to cancel the connection in case the user code wants 
to destroy the manager object or the application exits.

> Would you prefer:
> - a non blocking SCardConnect() using PCSCLITE_NO_BLOCKING?
> - or a SCardConnect() you can cancel using SCardCancel()?
The second one.

Regards,
Ievgenii


More information about the pcsclite-muscle mailing list