(self)
Handle one request, possibly blocking.

        Respects self.timeout.
Handle one request, possibly blocking.
Handle one request possibly blocking .
def handle_request(self):
        """Handle one request, possibly blocking.

        Respects self.timeout.
        """
        # Support people who used socket.settimeout() to escape
        # handle_request before self.timeout was available.
        timeout = self.socket.gettimeout()
        if timeout is None:
            timeout = self.timeout
        elif self.timeout is not None:
            timeout = min(timeout, self.timeout)
        if timeout is not None:
            deadline = time() + timeout

        # Wait until a request arrives or the timeout expires - the loop is
        # necessary to accommodate early wakeups due to EINTR.
        with _ServerSelector() as selector:
            selector.register(self, selectors.EVENT_READ)

            while True:
                ready = selector.select(timeout)
                if ready:
                    return self._handle_request_noblock()
                else:
                    if timeout is not None:
                        timeout = deadline - time()
                        if timeout < 0:
                            return self.handle_timeout()
def handle_request ( self ) : # Support people who used socket.settimeout() to escape # handle_request before self.timeout was available. timeout = self . socket . gettimeout ( ) if timeout is None : timeout = self . timeout elif self . timeout is not None : timeout = min ( timeout , self . timeout ) if timeout is not None : deadline = time ( ) + timeout # Wait until a request arrives or the timeout expires - the loop is # necessary to accommodate early wakeups due to EINTR. with _ServerSelector ( ) as selector : selector . register ( self , selectors . EVENT_READ ) while True : ready = selector . select ( timeout ) if ready : return self . _handle_request_noblock ( ) else : if timeout is not None : timeout = deadline - time ( ) if timeout < 0 : return self . handle_timeout ( )