예제 #1
0
 def doStopListening(self, *args, **kwargs):
     """
     Action method.
     """
     if online_status.isKnown(self.router_idurl):
         online_status.remove_online_status_listener_callbackove_(
             idurl=self.router_idurl,
             callback_method=self._on_router_contact_status_connected,
         )
         online_status.remove_online_status_listener_callbackove_(
             idurl=self.router_idurl,
             callback_method=self._on_router_contact_status_offline,
         )
     # if contact_status.isKnown(self.router_idurl):
     #     contact_status.A(self.router_idurl).removeStateChangedCallback(self._on_router_contact_status_connected)
     #     contact_status.A(self.router_idurl).removeStateChangedCallback(self._on_router_contact_status_offline)
     WriteMyOriginalIdentitySource('')
     config.conf().setString('services/proxy-transport/current-router', '')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     self.router_identity = None
     self.router_idurl = None
     self.router_proto_host = None
     self.request_service_packet_id = []
     self.router_connection_info = None
     my_id.rebuildLocalIdentity()
     if _Debug:
         lg.out(2, 'proxy_receiver.doStopListening')
예제 #2
0
 def stop(self):
     from access import key_ring
     from transport import callback
     callback.remove_inbox_callback(self._inbox_packet_received)
     callback.remove_outbox_callback(self._outbox_packet_sent)
     key_ring.shutdown()
     return True
 def stop(self):
     from transport import callback
     from stream import p2p_queue
     self.reconnect_task.stop()
     self.reconnect_task = None
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     p2p_queue.shutdown()
     return True
 def stop(self):
     from supplier import customer_assistant
     from transport import callback
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     callback.remove_outbox_callback(self._on_outbox_packet_sent)
     for sc in customer_assistant.assistants().values():
         sc.automat('shutdown')
     return True
예제 #5
0
 def stop(self):
     from main import events
     from transport import callback
     events.remove_subscriber(self._on_key_erased, 'key-erased')
     events.remove_subscriber(self._on_my_list_files_refreshed, 'my-list-files-refreshed')
     events.remove_subscriber(self._on_supplier_modified, 'supplier-modified')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     return True
예제 #6
0
 def doDestroyMe(self, arg):
     """
     Action method.
     """
     callback.remove_inbox_callback(self._on_inbox_packet)
     automat.objects().pop(self.index)
     global _CoinsMiner
     del _CoinsMiner
     _CoinsMiner = None
예제 #7
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     callback.remove_inbox_callback(self._inbox_packet_received)
     self.unregister()
     global _AccountantsFinder
     del _AccountantsFinder
     _AccountantsFinder = None
예제 #8
0
 def doDestroyMe(self, *args, **kwargs):
     """
     Remove all references to the state machine object to destroy it.
     """
     callback.remove_inbox_callback(self._inbox_packet_received)
     self.unregister()
     global _BroadcastersFinder
     del _BroadcastersFinder
     _BroadcastersFinder = None
예제 #9
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     callback.remove_inbox_callback(self._inbox_packet_received)
     automat.objects().pop(self.index)
     global _AccountantsFinder
     del _AccountantsFinder
     _AccountantsFinder = None
예제 #10
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     self.incoming_broadcast_message_callback = None
     callback.remove_inbox_callback(self._on_inbox_packet)
     automat.objects().pop(self.index)
     global _BroadcastListener
     del _BroadcastListener
     _BroadcastListener = None
예제 #11
0
 def doDestroyMe(self, *args, **kwargs):
     """
     Remove all references to the state machine object to destroy it.
     """
     self.incoming_broadcast_message_callback = None
     callback.remove_inbox_callback(self._on_inbox_packet)
     self.unregister()
     global _BroadcastListener
     del _BroadcastListener
     _BroadcastListener = None
예제 #12
0
 def doDestroyMe(self, *args, **kwargs):
     """
     Action method.
     """
     callback.remove_inbox_callback(self._on_inbox_packet)
     self.destroy()
     global _CoinsMiner
     if self == _CoinsMiner:
         del _CoinsMiner
         _CoinsMiner = None
예제 #13
0
 def stop(self):
     from transport import gateway
     from transport import callback
     from transport import bandwidth
     callback.remove_inbox_callback(bandwidth.INfile)
     callback.remove_finish_file_sending_callback(bandwidth.OUTfile)
     d = gateway.stop()
     bandwidth.shutdown()
     gateway.shutdown()
     return d
예제 #14
0
 def doDestroyMe(self, arg):
     """
     Action method.
     """
     callback.remove_inbox_callback(self._on_inbox_packet)
     self.unregister()
     global _CoinsMiner
     if self == _CoinsMiner:
         del _CoinsMiner
         _CoinsMiner = None
예제 #15
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     self.pending_coins = None
     self.connected_accountants = None
     callback.remove_inbox_callback(self._on_inbox_packet)
     automat.objects().pop(self.index)
     global _AccountantNode
     del _AccountantNode
     _AccountantNode = None
예제 #16
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     self.pending_coins = None
     self.connected_accountants = None
     callback.remove_inbox_callback(self._on_inbox_packet)
     self.unregister()
     global _AccountantNode
     del _AccountantNode
     _AccountantNode = None
예제 #17
0
    def stop(self):
        from transport import gateway
        from transport import callback
        from transport import bandwidth

        callback.remove_inbox_callback(bandwidth.INfile)
        callback.remove_finish_file_sending_callback(bandwidth.OUTfile)
        d = gateway.stop()
        bandwidth.shutdown()
        gateway.shutdown()
        return d
예제 #18
0
 def stop(self):
     from transport import callback
     from main import events
     # from contacts import contactsdb
     # for customer_idurl in contactsdb.customers():
     #     events.send('existing-customer-terminated', data=dict(idurl=customer_idurl))
     events.remove_subscriber(self._on_customer_accepted, 'existing-customer-accepted')
     events.remove_subscriber(self._on_customer_accepted, 'new-customer-accepted')
     events.remove_subscriber(self._on_customer_terminated, 'existing-customer-denied')
     events.remove_subscriber(self._on_customer_terminated, 'existing-customer-terminated')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     return True
예제 #19
0
 def doStopListening(self, arg):
     """
     Action method.
     """
     config.conf().setString('services/proxy-transport/current-router', '')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     self.router_identity = None
     self.router_idurl = None
     self.router_proto_host = None
     self.request_service_packet_id = []
     if _Debug:
         lg.out(2, 'proxy_receiver.doStopListening')
예제 #20
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     # gateway.remove_transport_state_changed_callback(self._on_transport_state_changed)
     network_connector.A().removeStateChangedCallback(self._on_network_connector_state_changed)
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     callback.remove_finish_file_sending_callback(self._on_finish_file_sending)
     automat.objects().pop(self.index)
     global _ProxyRouter
     del _ProxyRouter
     _ProxyRouter = None
예제 #21
0
 def stop(self):
     from transport import callback
     from chat import message
     from chat import message_keeper
     from chat import message_db
     from chat import nickname_holder
     message_keeper.shutdown()
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     nickname_holder.Destroy()
     message_db.shutdown()
     message.shutdown()
     return True
 def stop(self):
     from twisted.internet import reactor  # @UnresolvedImport
     from main import events
     from supplier import customer_assistant
     from transport import callback
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     callback.remove_outbox_callback(self._on_outbox_packet_sent)
     events.remove_subscriber(self._on_identity_url_changed,
                              'identity-url-changed')
     for ca in customer_assistant.assistants().values():
         reactor.callLater(0, ca.automat, 'shutdown')  # @UndefinedVariable
     return True
예제 #23
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     self.target_idurl = None
     self.target_service = None
     self.requested_packet_id = None
     self.request_service_params = None
     self.lookup_task = None
     self.exclude_nodes = []
     callback.remove_inbox_callback(self._inbox_packet_received)
     self.unregister()
 def stop(self):
     from main import events
     from transport import callback
     from stream import message
     from chat import nickname_holder
     events.remove_subscriber(self._on_user_connected, 'node-connected')
     events.remove_subscriber(self._on_user_disconnected,
                              'node-disconnected')
     events.remove_subscriber(self._on_identity_url_changed,
                              'identity-url-changed')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     nickname_holder.Destroy()
     message.shutdown()
     return True
예제 #25
0
def shutdown():
    """
    Called from top level code when the software is finishing.
    """
    global _ShutdownFlag
    global _ContactsStatusDict
    lg.out(4, 'contact_status.shutdown')
    callback.remove_inbox_callback(Inbox)
    callback.remove_outbox_callback(Outbox)
    callback.remove_queue_item_status_callback(OutboxStatus)
    for A in _ContactsStatusDict.values():
        A.destroy()
    _ContactsStatusDict.clear()
    _ShutdownFlag = True
예제 #26
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     global _SupplierFinder
     del _SupplierFinder
     _SupplierFinder = None
     callback.remove_inbox_callback(self._inbox_packet_received)
     if self.target_idurl:
         sc = supplier_connector.by_idurl(self.target_idurl)
         if sc:
             sc.remove_callback('supplier_finder')
         self.target_idurl = None
     self.destroy()
     lg.out(14, 'supplier_finder.doDestroyMy index=%s' % self.index)
예제 #27
0
 def stop(self):
     from storage import backup_fs
     from storage import backup_monitor
     from storage import backup_control
     from transport import callback
     from p2p import p2p_connector
     from main.config import conf
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     if p2p_connector.A():
         p2p_connector.A().removeStateChangedCallback(self._on_p2p_connector_state_changed)
     backup_monitor.Destroy()
     backup_fs.shutdown()
     backup_control.shutdown()
     conf().removeCallback('services/backups/keep-local-copies-enabled')
     return True
예제 #28
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     global _SupplierFinder
     del _SupplierFinder
     _SupplierFinder = None
     callback.remove_inbox_callback(self._inbox_packet_received)
     if self.target_idurl:
         sc = supplier_connector.by_idurl(self.target_idurl)
         if sc:
             sc.remove_callback('supplier_finder')
         self.target_idurl = None
     self.destroy()
     lg.out(14, 'supplier_finder.doDestroyMy index=%s' % self.index)
예제 #29
0
 def doDestroyMe(self, arg):
     """
     Remove all references to the state machine object to destroy it.
     """
     # gateway.remove_transport_state_changed_callback(self._on_transport_state_changed)
     if network_connector.A():
         network_connector.A().removeStateChangedCallback(
             self._on_network_connector_state_changed)
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     callback.remove_finish_file_sending_callback(
         self._on_finish_file_sending)
     self.unregister()
     global _ProxyRouter
     del _ProxyRouter
     _ProxyRouter = None
예제 #30
0
 def doStopListening(self, *args, **kwargs):
     """
     Action method.
     """
     if _Debug:
         lg.args(_DebugLevel, router_idurl=self.router_idurl)
     if online_status.isKnown(self.router_idurl):
         online_status.remove_online_status_listener_callback(
             idurl=self.router_idurl,
             callback_method=self._on_router_contact_status_connected,
         )
         online_status.remove_online_status_listener_callback(
             idurl=self.router_idurl,
             callback_method=self._on_router_contact_status_offline,
         )
     active_router_session_machine_index = None
     if self.router_connection_info:
         active_router_session_machine = None
         active_router_session_machine_index = self.router_connection_info.get('index', None)
         if active_router_session_machine_index is not None:
             active_router_session_machine = automat.by_index(active_router_session_machine_index)
         if not active_router_session_machine:
             active_router_sessions = gateway.find_active_session(
                 proto=self.router_connection_info.get('proto'),
                 host=self.router_connection_info.get('host'),
             )
             if not active_router_sessions:
                 active_router_sessions = gateway.find_active_session(
                     proto=self.router_connection_info.get('proto'),
                     idurl=id_url.to_bin(self.router_idurl),
                 )
             if active_router_sessions:
                 active_router_session_machine = automat.by_index(active_router_sessions[0].index)
         if active_router_session_machine is not None:
             active_router_session_machine.removeStateChangedCallback(self._on_router_session_disconnected)
             lg.info('removed callback from router active session: %r' % active_router_session_machine)
         else:
             lg.err('did not found active router session state machine with index %s' % active_router_session_machine_index)
     WriteMyOriginalIdentitySource('')
     config.conf().setString('services/proxy-transport/current-router', '')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     self.router_identity = None
     self.router_idurl = None
     self.router_id = ''
     self.router_proto_host = None
     self.request_service_packet_id = []
     self.router_connection_info = None
     my_id.rebuildLocalIdentity()
예제 #31
0
 def doStopListening(self, arg):
     """
     Action method.
     """
     if not ReadMyOriginalIdentitySource():
         lg.warn('my original identity is not empty')
     else:
         config.conf().setData('services/proxy-transport/my-original-identity', '')
     config.conf().setString('services/proxy-transport/current-router', '')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     self.router_identity = None
     self.router_idurl = None
     self.router_proto_host = None
     self.request_service_packet_id = []
     if _Debug:
         lg.out(2, 'proxy_receiver.doStopListening')
예제 #32
0
 def stop(self):
     from transport import callback
     from main import events
     from services import driver
     from supplier import customer_space
     events.remove_subscriber(self._on_dht_layer_connected, event_id='dht-layer-connected')
     if driver.is_on('service_entangled_dht'):
         from dht import dht_service
         from dht import dht_records
         dht_service.suspend(layer_id=dht_records.LAYER_SUPPLIERS)
     events.remove_subscriber(customer_space.on_customer_accepted, 'existing-customer-accepted')
     events.remove_subscriber(customer_space.on_customer_accepted, 'new-customer-accepted')
     events.remove_subscriber(customer_space.on_customer_terminated, 'existing-customer-denied')
     events.remove_subscriber(customer_space.on_customer_terminated, 'existing-customer-terminated')
     events.remove_subscriber(customer_space.on_identity_url_changed, 'identity-url-changed')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     return True
예제 #33
0
def shutdown():
    """
    Called from top level code when the software is finishing.
    """
    global _OfflineCheckTask
    global _ShutdownFlag
    global _OnlineStatusDict
    lg.out(4, 'online_status.shutdown')
    _OfflineCheckTask.stop()
    del _OfflineCheckTask
    _OfflineCheckTask = None
    callback.remove_inbox_callback(Inbox)
    callback.remove_queue_item_status_callback(OutboxStatus)
    for o_status in list(_OnlineStatusDict.values()):
        o_status.automat('shutdown')
    _OnlineStatusDict.clear()
    _ShutdownFlag = True
예제 #34
0
 def stop(self):
     from transport import callback
     from p2p import contact_status
     from p2p import p2p_service
     from p2p import p2p_connector
     from p2p import network_connector
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     callback.remove_inbox_callback(p2p_service.inbox)
     if network_connector.A():
         network_connector.A().removeStateChangedCallback(
             self._on_network_connector_switched)
     p2p_connector.A().removeStateChangedCallback(
         self._on_p2p_connector_switched)
     contact_status.shutdown()
     p2p_connector.Destroy()
     p2p_service.shutdown()
     return True
예제 #35
0
 def stop(self):
     from storage import backup_fs
     from storage import backup_monitor
     from storage import backup_control
     from transport import callback
     from p2p import p2p_connector
     from main import events
     from main.config import conf
     events.remove_subscriber(self._on_key_erased, 'key-erased')
     events.remove_subscriber(self._on_my_identity_rotated, 'my-identity-rotated')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     if p2p_connector.A():
         p2p_connector.A().removeStateChangedCallback(self._on_p2p_connector_state_changed)
     backup_monitor.Destroy()
     backup_fs.shutdown()
     backup_control.shutdown()
     conf().removeConfigNotifier('services/backups/keep-local-copies-enabled')
     return True
예제 #36
0
 def stop(self):
     from transport import callback
     from main import events
     from p2p import online_status
     from p2p import p2p_service
     from p2p import p2p_connector
     from p2p import network_connector
     from p2p import ratings
     events.remove_subscriber(self._on_my_identity_url_changed, 'my-identity-url-changed')
     events.remove_subscriber(self._on_identity_url_changed, 'identity-url-changed')
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     callback.remove_inbox_callback(p2p_service.inbox)
     if network_connector.A():
         network_connector.A().removeStateChangedCallback(
             self._on_network_connector_switched)
     p2p_connector.A().removeStateChangedCallback(
         self._on_p2p_connector_switched)
     ratings.shutdown()
     online_status.shutdown()
     p2p_connector.Destroy()
     p2p_service.shutdown()
     return True
예제 #37
0
def shutdown():
    if _Debug:
        lg.out(_DebugLevel, "p2p_service.shutdown")
    callback.remove_inbox_callback(inbox)
예제 #38
0
 def stop(self):
     from transport import callback
     from p2p import p2p_queue
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     p2p_queue.shutdown()
     return True
예제 #39
0
 def stop(self):
     from transport import callback
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     return True
예제 #40
0
 def stop(self):
     from main import events
     from transport import callback
     events.remove_subscriber(self._on_supplier_modified)
     callback.remove_inbox_callback(self._on_inbox_packet_received)
     return True