コード例 #1
0
ファイル: NetworkState.py プロジェクト: kans/BitBlinder
 def _port_test_failure(reason):
     # is this one of the errors that corresponds to unreachability?
     if Basic.exception_is_a(reason, [CannotListenError, TimeoutError]):
         return False
     # otherwise, we do not know the state of reachability (None signals that)
     # and log the error if necessary
     unexpectedException = not Basic.exception_is_a(reason, [ConnectError])
     if unexpectedException:
         log_ex(reason, "Unexpected failure while testing port")
     return None
コード例 #2
0
 def _port_test_failure(reason):
     #is this one of the errors that corresponds to unreachability?
     if Basic.exception_is_a(reason, [CannotListenError, TimeoutError]):
         return False
     #otherwise, we do not know the state of reachability (None signals that)
     #and log the error if necessary
     unexpectedException = not Basic.exception_is_a(reason, [ConnectError])
     if unexpectedException:
         log_ex(reason, "Unexpected failure while testing port")
     return None
コード例 #3
0
ファイル: Circuit.py プロジェクト: clawplach/BitBlinder
 def error(failure):
   if not self.is_done():
     if Basic.exception_is_a(failure, [TorCtl.TorCtlClosed, TorCtl.ErrorReply]):
       log_msg("Failed to create PAR client, closing", 1, "circuit")
     else:
       log_ex(failure, "Unexpected failure while starting circuit")
     self.on_done()
コード例 #4
0
 def on_failure(reason):
     #is this an expected failure for a single UDP reply test?
     if Basic.exception_is_a(
             reason, [CannotListenError, ConnectError, TimeoutError]):
         return
     #otherwise, log the error
     log_ex(reason, "Unexpected failure while testing UDP replies")
コード例 #5
0
ファイル: Circuit.py プロジェクト: wallydz/BitBlinder
 def error(failure):
     if not self.is_done():
         if Basic.exception_is_a(
                 failure,
             [TorCtl.TorCtlClosed, TorCtl.ErrorReply]):
             log_msg("Failed to create PAR client, closing", 1,
                     "circuit")
         else:
             log_ex(
                 failure,
                 "Unexpected failure while starting circuit")
         self.on_done()
コード例 #6
0
ファイル: NetworkState.py プロジェクト: kans/BitBlinder
 def on_failure(reason):
     # is this an expected failure for a single UDP reply test?
     if Basic.exception_is_a(reason, [CannotListenError, ConnectError, TimeoutError]):
         return
     # otherwise, log the error
     log_ex(reason, "Unexpected failure while testing UDP replies")
コード例 #7
0
ファイル: NetworkState.py プロジェクト: kans/BitBlinder
 def udp_test_failure(reason):
     if Basic.exception_is_a(reason, [TimeoutError]):
         return False
     log_ex(reason, "Unexpected failure while testing UDP")
     return None
コード例 #8
0
 def udp_test_failure(reason):
     if Basic.exception_is_a(reason, [TimeoutError]):
         return False
     log_ex(reason, "Unexpected failure while testing UDP")
     return None