fix bugs in last few commits
[uccvend-vendserver.git] / sql-edition / servers / VendingMachine.py
index 9fe5245..9506daf 100644 (file)
@@ -2,6 +2,7 @@
 import re
 from CRC import do_crc
 from select import select
+import socket
 
 asynchronous_responses = [     '400', '401', # door open/closed
                                '610',        # switches changed
@@ -62,7 +63,8 @@ class VendingMachine:
                        s = ''
                        while s == '':
                                s = self.rfh.readline()
-                               if s == '': return None
+                               if s == '':
+                                       raise VendingException('Input socket has closed!')
                                s = s.strip('\r\n')
                        code = s[0:3]
                        text = s[4:]

UCC git Repository :: git.ucc.asn.au