Exemplo n.º 1
0
Arquivo: server.py Projeto: taavi/dirt
 def handle_connection(self):
     try:
         while 1:
             self._handle_one_message()
     except Exception, e:
         if not is_expected(e):
             raise
         self.log.debug("got expected exception: %r", e)
Exemplo n.º 2
0
 def handle_connection(self):
     try:
         while 1:
             self._handle_one_message()
     except Exception, e:
         if not is_expected(e):
             raise
         self.log.debug("got expected exception: %r", e)
Exemplo n.º 3
0
Arquivo: server.py Projeto: taavi/dirt
    def accept_connection(self, socket, address):
        log_prefix = "connection from %s:%s: " % address
        log.debug(log_prefix + "accepting")

        handler = ConnectionHandler(self.execute_call)
        try:
            handler.accept(socket, address)
        except Exception, e:
            if isinstance(e, SocketError) or is_expected(e):
                log.info(log_prefix + "ignoring expected exception %r", e)
            else:
                log.exception(log_prefix + "unexpected exception:")
Exemplo n.º 4
0
    def accept_connection(self, socket, address):
        log_prefix = "connection from %s:%s: " % address
        log.debug(log_prefix + "accepting")

        handler = ConnectionHandler(self.execute_call)
        try:
            handler.accept(socket, address)
        except Exception, e:
            if isinstance(e, SocketError) or is_expected(e):
                log.info(log_prefix + "ignoring expected exception %r", e)
            else:
                log.exception(log_prefix + "unexpected exception:")