Verified Commit 97410cc2 authored by Clayton Craft's avatar Clayton Craft
Browse files

main: handle cases where the conn might be broken when sending (MR 3)

There seem to be cases where the connection might be closed before it is
caught by the handle_connection loop
parent 5cd8c403
......@@ -127,7 +127,13 @@ class GnssShare:
await self._active_driver.open()
sentence = await self._active_driver.readline()
for conn in self._open_connections:
await conn.send_all(sentence)
try:
await conn.send_all(sentence)
# Sometimes a disconnect isn't caught in time by the
# handle_connection loop
except trio.BrokenResourceError:
self.__log.info("Unable to send to socket client, "
"maybe connection closed?")
else:
if self._active_driver is not None:
self.__log.info("No more clients connected, closing "
......
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