git.ucc.asn.au
/
uccvend-vendserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make syslog logging work
[uccvend-vendserver.git]
/
sql-edition
/
servers
/
VendingMachine.py
diff --git
a/sql-edition/servers/VendingMachine.py
b/sql-edition/servers/VendingMachine.py
index
9fe5245
..
9506daf
100644
(file)
--- a/
sql-edition/servers/VendingMachine.py
+++ b/
sql-edition/servers/VendingMachine.py
@@
-2,6
+2,7
@@
import re
from CRC import do_crc
from select import select
import re
from CRC import do_crc
from select import select
+import socket
asynchronous_responses = [ '400', '401', # door open/closed
'610', # switches changed
asynchronous_responses = [ '400', '401', # door open/closed
'610', # switches changed
@@
-62,7
+63,8
@@
class VendingMachine:
s = ''
while s == '':
s = self.rfh.readline()
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:]
s = s.strip('\r\n')
code = s[0:3]
text = s[4:]
UCC
git Repository :: git.ucc.asn.au