Hello,

On 08/07/06, Geoff Elgey <[EMAIL PROTECTED]> wrote:
  Attached is example code of a reader loop that calls SCardGetReaderList(),
then SCardGetStatusChange(). The loop continues on success or timeout, and
exits on error. Also attached is the pcscd output, and the output of the
reader loop.

 The reader loop output shows that, while the reader is attached,
SCardGetReaderList() returns 1 reader, and SCardGetStatusChange() returns an
event state indicating a card is present. Then pcscd is killed (as seen by
the pcscd output), but the reader loop output then shows that
SCardGetReaderList() returns 0 readers, and SCardGetStatusChange() times
out, since no event is possible (and so on as it loops back). If I had
called SCardGetStatusChange(), it would block indefinitely.

 Maybe the code I've got here is wrong and I'm missing some fundamental
point. But I cannot distinguish between "no readers attached, so keep
waiting for an event" and "pcscd has stopped running and
SCardEstablishContext() must be called again as the current context is
invalid". Unless I create a new context every time 0 readers are returned,
which does not seem to be optimal.

I found the problem. It is now corrected in revision 2102 [1].
"Log message:
SCardCheckDaemonAvailability(): test the presence of
PCSCLITE_PUBSHM_FILE (/var/run/pcscd.pub) instead of PCSCLITE_IPC_DIR
(/var/run) to detect the presence of pcscd

Thanks to Geoff Elgey for the bug report"

Thanks,

[1] http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/?rev=2102&sc=1

--
 Dr. Ludovic Rousseau
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to