Skip to content

Commit

Permalink
Attempt reconnecting when lost
Browse files Browse the repository at this point in the history
  • Loading branch information
XDelta committed May 25, 2021
1 parent 576f455 commit 73bba03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sACN_Websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ async def localServer(websocket, path):
await dmxSender(websocket)

async def remoteSender(): #connect to external ws server
async with websockets.connect(config.ws_uri) as websocket:
await dmxSender(websocket)
while True:
wssl.log(("Connecting to {0}").format(config.ws_uri))
async with websockets.connect(config.ws_uri) as websocket:
await dmxSender(websocket)
wssl.log("Lost connection to remote host")

async def dmxSender(websocket):
running = True
Expand Down

0 comments on commit 73bba03

Please sign in to comment.