mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Version 2.3.8
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
@ -39,23 +39,6 @@ class Client(object):
|
|||||||
|
|
||||||
async def start_websocket(self, consumer):
|
async def start_websocket(self, consumer):
|
||||||
s = "%s/events" % self.websocket
|
s = "%s/events" % self.websocket
|
||||||
# while True:
|
|
||||||
# try:
|
|
||||||
# async with websockets.connect(s, ping_interval=60, ping_timeout=90) as ws:
|
|
||||||
# async for msg in ws:
|
|
||||||
# try:
|
|
||||||
# await consumer(msg)
|
|
||||||
# except Exception as ex:
|
|
||||||
# logging.debug("Error while parsing event (%s)", ex)
|
|
||||||
# except websockets.exceptions.ConnectionClosedError:
|
|
||||||
# logging.debug("Lost websocket connection. Reconnecting...")
|
|
||||||
# except websockets.exceptions.WebSocketException as wex:
|
|
||||||
# logging.debug("Websocket exception (%s)", wex)
|
|
||||||
# except OSError as e:
|
|
||||||
# logging.debug("Websocket OSError exception (%s) with parameter %s", e, s)
|
|
||||||
# except Exception as e:
|
|
||||||
# logging.debug("Other exception (%s) with parameter %s", e, s)
|
|
||||||
|
|
||||||
async with websockets.connect(s, ping_interval=60, ping_timeout=90) as ws:
|
async with websockets.connect(s, ping_interval=60, ping_timeout=90) as ws:
|
||||||
# After the websocket connection is opened, loop waiting for messages
|
# After the websocket connection is opened, loop waiting for messages
|
||||||
# Moved the websocket connection before the loop to avoid runaway websocket
|
# Moved the websocket connection before the loop to avoid runaway websocket
|
||||||
|
Reference in New Issue
Block a user