aboutsummaryrefslogtreecommitdiffstats
path: root/glutte_serial_web.py
diff options
context:
space:
mode:
authorMaximilien Cuony <maximilien@theglu.org>2016-09-12 22:27:35 +0200
committerMaximilien Cuony <maximilien@theglu.org>2016-09-12 22:27:35 +0200
commite9043a937b0bb103b43444bf63d7440e997e52ac (patch)
tree7357483b113ad79a13e42ce94a8b16ab39fec544 /glutte_serial_web.py
parent17ab8bd635cf5713a1af9fb5d3c767d347324f84 (diff)
downloadglutte-serial-web-e9043a937b0bb103b43444bf63d7440e997e52ac.tar.gz
glutte-serial-web-e9043a937b0bb103b43444bf63d7440e997e52ac.tar.bz2
glutte-serial-web-e9043a937b0bb103b43444bf63d7440e997e52ac.zip
More robust ws
Diffstat (limited to 'glutte_serial_web.py')
-rwxr-xr-xglutte_serial_web.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/glutte_serial_web.py b/glutte_serial_web.py
index 9966646..4390f76 100755
--- a/glutte_serial_web.py
+++ b/glutte_serial_web.py
@@ -48,8 +48,9 @@ def stream(socket):
try:
queue = ser.register_client()
+ error = False
- while not socket.closed:
+ while not socket.closed and not error:
# Force to check if the client is still here
try:
with Timeout(0.1, False):
@@ -61,6 +62,8 @@ def stream(socket):
socket.send(line)
except IndexError:
pass
+ except:
+ error = True
sleep(0.1)
except:
raise