def stop(self): from p2p import p2p_service from p2p import contact_status from p2p import p2p_connector from p2p import network_connector 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
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