diff options
author | elie <elie> | 2013-03-15 20:53:22 +0000 |
---|---|---|
committer | elie <elie> | 2013-03-15 20:53:22 +0000 |
commit | bbb859341dee37353a93f180a941ae9fe39657a6 (patch) | |
tree | d39084d4e81b01cfba8df2d7c926f5e7ebb754df /pysnmp/carrier | |
parent | dd85f9d672e0767beafa55810ac3b3342d35d302 (diff) | |
download | pysnmp-bbb859341dee37353a93f180a941ae9fe39657a6.tar.gz |
* explicit twisted dispatcher's timer resolution (of 1 sec) removed to make
use of global default of 0.5 sec.
* intermediate handleTimeout() method replaced with lambda
Diffstat (limited to 'pysnmp/carrier')
-rw-r--r-- | pysnmp/carrier/twisted/dispatch.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pysnmp/carrier/twisted/dispatch.py b/pysnmp/carrier/twisted/dispatch.py index 7304e95..4f77cd0 100644 --- a/pysnmp/carrier/twisted/dispatch.py +++ b/pysnmp/carrier/twisted/dispatch.py @@ -20,12 +20,9 @@ class TwistedDispatcher(AbstractTransportDispatcher): self.__transportCount = 0 if 'timeout' in kwargs: self.setTimerResolution(kwargs['timeout']) - else: - self.setTimerResolution(1.0) - self.loopingcall = task.LoopingCall(self.handleTimeout) - - def handleTimeout(self): - self.handleTimerTick(time.time()) + self.loopingcall = task.LoopingCall( + lambda self=self: self.handleTimerTick(time.time()) + ) def runDispatcher(self, timeout=0.0): if not reactor.running: |