[Pcsclite-muscle] Asynchronous PCSC API
Ludovic Rousseau
ludovic.rousseau at gmail.com
Tue Jan 25 08:39:34 PST 2022
Le mar. 25 janv. 2022 à 12:56, Ievgenii Meshcheriakov
<ievgenii.meshcheriakov at qt.io> a écrit :
>
> понеділок, 24 січня 2022 р. 18:12:17 CET Ludovic Rousseau написано:
> > It is not exactly what you request but have a look at
> > https://salsa.debian.org/rousseau/PCSC/-/commit/c7cd36bd165f386755aa71af9e6c
> > 28fc93f3bf45
> Setting PCSCLITE_NO_BLOCKING didn't help, the SCardConnect call is still
> blocking and cannot be cancelled.
Exact.
But maybe the same idea could be used also for SCardConnect()?
> > Have you tried your sample code on Windows?
> > What is the behaviour of WinSCard on Windows?
>
> I've adapted the code for Windows and there the SCardConnect call is still
> blocking, but it can be cancelled using SCardCancel. The return value is then
> SCARD_E_CANCELLED as expected.
Good to know.
Maybe I should implement a similar behaviour in pcsc-lite.
You are the first one to request this feature.
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?
Would you prefer:
- a non blocking SCardConnect() using PCSCLITE_NO_BLOCKING?
- or a SCardConnect() you can cancel using SCardCancel()?
Bye
--
Dr. Ludovic Rousseau
More information about the pcsclite-muscle
mailing list