Ejemplo n.º 1
0
 def _get_out_connection(self, address):
     try:
         connection = self._out_connections[address]
     except KeyError:
         try:
             connection = Connection.get_client(address, 1024 * 8)
             self._out_connections[address] = connection
         except ConnectFailException, e:
             self._logger.warning(e.message)
             return False
Ejemplo n.º 2
0
 def _start_server(self):
     server = Connection.get_server(self._address, self._backlog)
     fd = server.get_fileno()
     self._in_connections[fd] = server
     self._in_handlers[fd] = ServerHandler(server, self)
     self._epoll.register(fd, select.EPOLLIN)