Skip to content

Commit

Permalink
Fixed a dispatch bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Feb 20, 2024
1 parent b6ce6d0 commit a8b439d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pysnmp/carrier/asyncio/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ def runDispatcher(self, timeout=0.0):
if not self.loop.is_running():
try:
if timeout > 0:
self.loop.call_later(timeout, self.closeDispatcher)
self.loop.call_later(timeout, self.__closeDispatcher)
self.loop.run_forever()
except KeyboardInterrupt:
raise
except Exception:
raise PySnmpError(';'.join(traceback.format_exception(*sys.exc_info())))

def closeDispatcher(self):
self.loop.stop()

def __closeDispatcher(self):
if self.loop.is_running():
self.loop.stop()
super().closeDispatcher()

def registerTransport(self, tDomain, transport):
Expand Down

0 comments on commit a8b439d

Please sign in to comment.