summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pysnmp/carrier/asyncore/dispatch.py4
-rw-r--r--pysnmp/carrier/base.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/pysnmp/carrier/asyncore/dispatch.py b/pysnmp/carrier/asyncore/dispatch.py
index 81fbc013..1d88ed19 100644
--- a/pysnmp/carrier/asyncore/dispatch.py
+++ b/pysnmp/carrier/asyncore/dispatch.py
@@ -46,11 +46,11 @@ class AsynsockDispatcher(base.AbstractTransportDispatcher):
base.AbstractTransportDispatcher.unregisterTransports(self, tDomain)
def runDispatcher(self, liveForever=1):
- self.doDispatchFlag = liveForever
+ self._doDispatchFlag = liveForever
while 1:
poll(self.timeout, self.__sockMap)
self.handleTimerTick(time())
- if not self.doDispatchFlag:
+ if not self._doDispatchFlag:
break
# XXX doDispatchFlag is needed?
diff --git a/pysnmp/carrier/base.py b/pysnmp/carrier/base.py
index 71d88808..36a62b92 100644
--- a/pysnmp/carrier/base.py
+++ b/pysnmp/carrier/base.py
@@ -3,7 +3,7 @@ from pysnmp.carrier import error
class AbstractTransportDispatcher:
def __init__(self):
- self.doDispatchFlag = 1
+ self._doDispatchFlag = 1
self.__transports = {}
self.__recvCbFun = self.__timerCbFun = None
@@ -82,6 +82,9 @@ class AbstractTransportDispatcher:
def runDispatcher(self, timeout=0.0):
raise error.CarrierError('Method not implemented')
+ def stopDispatcher(self):
+ self._doDispatchFlag = 0
+
def closeDispatcher(self):
self.closeTransports()
for tDomain in self.__transports.keys():