diff options
author | elie <elie> | 2013-03-15 20:53:22 +0000 |
---|---|---|
committer | elie <elie> | 2013-03-15 20:53:22 +0000 |
commit | 85f9557f882bd07734f9379c1d047085f70c81a1 (patch) | |
tree | 9b5c12fc9646e731df25dbcba6d1468a9c7c8351 /pysnmp/carrier | |
parent | 7fc7d79936e7abd197932bec2b304e046581ea6b (diff) | |
download | pysnmp-git-85f9557f882bd07734f9379c1d047085f70c81a1.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 7304e958..4f77cd0c 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: |