def clear(self): """Clear the list of sessions and prepare for next round of append->dispatch->subscript cycle. """ self._requests = [] self._responses = [] self._durty = 0 # [Re-]create SNMP manager transport self.transport = role.manager(self.iface)
def __init__(self, cb_fun, cb_ctx=None, dst=None, iface=("0.0.0.0", 0)): # Make sure we get the callback function if not callable(cb_fun): raise BadArgument("Bad callback function") # Keep references to data and method objects supplied # by caller for callback on request completion. self.callback_ctx = cb_ctx self.callback_fun = cb_fun # Call parent classes constructor asyncore.dispatcher.__init__(self) # Create an instance of manager transport class self.manager = role.manager(dst, iface) # Create a socket and pass it to asyncore dispatcher self.set_socket(self.manager.open())
def __init__(self, cb_fun, cb_ctx=None, dst=None, iface=('0.0.0.0', 0)): # Make sure we get the callback function if not callable(cb_fun): raise BadArgument('Bad callback function') # Keep references to data and method objects supplied # by caller for callback on request completion. self.callback_ctx = cb_ctx self.callback_fun = cb_fun # Call parent classes constructor asyncore.dispatcher.__init__(self) # Create an instance of manager transport class self.manager = role.manager(dst, iface) # Create a socket and pass it to asyncore dispatcher self.set_socket(self.manager.open())