Commit e4999c06 authored by Paul van der Linden's avatar Paul van der Linden
Browse files

send out keep alive

parent 3ee7a5ac
...@@ -79,6 +79,10 @@ class StreamListener(object): ...@@ -79,6 +79,10 @@ class StreamListener(object):
else: else:
logging.error("Unknown message type: " + str(raw_data)) logging.error("Unknown message type: " + str(raw_data))
def keep_alive(self):
"""Called when a keep-alive arrived"""
return
def on_status(self, status): def on_status(self, status):
"""Called when a new status arrives""" """Called when a new status arrives"""
return return
...@@ -293,7 +297,7 @@ class Stream(object): ...@@ -293,7 +297,7 @@ class Stream(object):
while True: while True:
line = buf.read_line().strip() line = buf.read_line().strip()
if not line: if not line:
pass # keep-alive new lines are expected self.listener.keep_alive() # keep-alive new lines are expected
elif line.isdigit(): elif line.isdigit():
length = int(line) length = int(line)
break break
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment