From 7f37e22c9d99f8e275fc62a3d852b5627b6638de Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Tue, 12 Oct 2010 12:24:21 +0000 Subject: [PATCH] let vicc recognize shutdown of vpcd git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@323 96b47cad-a561-4643-ad3b-153ac7d7599c --- virtualsmartcard/src/vpicc/VirtualSmartcard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/virtualsmartcard/src/vpicc/VirtualSmartcard.py b/virtualsmartcard/src/vpicc/VirtualSmartcard.py index ec42ec7..1e3c19a 100644 --- a/virtualsmartcard/src/vpicc/VirtualSmartcard.py +++ b/virtualsmartcard/src/vpicc/VirtualSmartcard.py @@ -529,7 +529,11 @@ class VirtualICC(object): # {{{ def __recvFromVPICC(self): # receive message size - size = struct.unpack('!H', self.sock.recv(_Csizeof_short))[0] + sizestr = self.sock.recv(_Csizeof_short) + if len(sizestr) == 0: + print "Virtual PCD shut down" + sys.exit() + size = struct.unpack('!H', sizestr)[0] # receive and return message if size: