<div dir="ltr">Thanks Ludovic.<div><br></div><div>Normally pcscd wouldn't be shut down., and the init/systemd script priorities set up such that pcscd is always running before the client application.   But this is a long running, embedded application where it is conceivable that pcscd might be for example updated during operation.  And yes these updates can be scripted (at the moment we use saltstack) to ensure that the application is restarted after pcscd is restarted, so the error shouldn't (with care) happen.  But we might find this too complicated in the field and want it to be more tolerant of the order in which things are brought up and down.</div><div><br></div><div>In my development work where I am running pcscd in the foreground, I saw this error occur and that it results in an easily recognizable exception, so I want to be able to recover from it.  But if the structure of the library doesn't allow it, I can recover from it by having my application exit and be respawned, or have it close all descriptors and re-exec itself if running in the foreground.  But these are heavy handed approaches and I'd hoped to find something more elegant.</div><div><br></div><div>Thanks</div><div>Ben</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 18, 2016 at 3:39 AM, Ludovic Rousseau <span dir="ltr"><<a href="mailto:ludovic.rousseau@gmail.com" target="_blank">ludovic.rousseau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<br><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2016-10-18 3:58 GMT+02:00 Ben Mehlman <span dir="ltr"><<a href="mailto:ben.mehlman@sweetsams.com" target="_blank">ben.mehlman@sweetsams.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><br></div>Using the higher level classes of pyscard (CardRequest, CardService).. if pcscd is shut down temporarily, it results in a ListReadersException.  I would like to catch this exception, retry, and recover from it when pcscd becomes available again.<br><br></div>I tried recreating the CardRequest but that wasn't sufficient to recreate the connection to pcscd.<br></div>Is there a correct way to handle this?<br></div></div></div></blockquote><div><br></div></span><div>You need to re-establish a connection to the server using SCardEstablishContext().<br></div><div>That may not be easy to do from the high level API.<br></div></div><br></div><div class="gmail_extra">Why is pcscd shut down?<br><br></div><div class="gmail_extra">Bye<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br>-- <br><div class="m_5076031649978775327gmail_signature"> Dr. Ludovic Rousseau</div>
</div></font></span></div></div>
<br>______________________________<wbr>_________________<br>
Pcsclite-muscle mailing list<br>
<a href="mailto:Pcsclite-muscle@lists.alioth.debian.org">Pcsclite-muscle@lists.alioth.<wbr>debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle" rel="noreferrer" target="_blank">http://lists.alioth.debian.<wbr>org/cgi-bin/mailman/listinfo/<wbr>pcsclite-muscle</a><br></blockquote></div><br></div>