Пример #1
0
 def __init__(self, addr=None):
   if not addr:
     addr = FLAGS.kb_core_addr
   self._addr = util.str_to_addr(addr)
   self._last_reconnect = 0
   self._num_retries = 0
   GatenetProtocolHandler.__init__(self)
Пример #2
0
 def __init__(self, name, kb_env, addr='', port=0, qsize=5):
   self._name = name
   self._kb_env = kb_env
   self._logger = logging.getLogger(self._name)
   self._bind_address = util.str_to_addr(addr)
   self._qsize = qsize
   self._clients = set()
   self._lock = threading.Lock()
   asyncore.dispatcher.__init__(self)
Пример #3
0
 def __init__(self, client):
   self._addr = util.str_to_addr(FLAGS.http_addr)
   self._logger = logging.getLogger('proxy-http')
   self.client = client
   HTTPServer.__init__(self, self._addr, ProxyRequestHandler)