Ejemplo n.º 1
0
    def __init__(self, routercontainer, protocol):
        """
        :param routercontainer: should implement
        :class:`txtorcon.interface.IRouterContainer`.

        :param protocol: should implement
        :class:`txtorcon.interface.ITorControlProtocol`
        """
        self.listeners = []
        self.router_container = IRouterContainer(routercontainer)
        self.protocol = ITorControlProtocol(protocol)
        self.path = []
        self.streams = []
        self.purpose = None
        self.id = None
        self.state = 'UNKNOWN'
        self.build_flags = []

        ## this is used to hold a Deferred that will callback() when
        ## this circuit is being CLOSED or FAILED.
        self._closing_deferred = None
Ejemplo n.º 2
0
    def __init__(self, routercontainer):
        """
        :param routercontainer: should implement
        :class:`txtorcon.interface.IRouterContainer`.
        """
        self.listeners = []
        self.router_container = IRouterContainer(routercontainer)
        self.torstate = routercontainer
        self.path = []
        self.streams = []
        self.purpose = None
        self.id = None
        self.state = 'UNKNOWN'
        self.build_flags = []
        self.flags = {}

        ## this is used to hold a Deferred that will callback() when
        ## this circuit is being CLOSED or FAILED.
        self._closing_deferred = None

        ## caches parsed value for time_created()
        self._time_created = None