def handle_request(self): L = coselect.poll_list([(self, coselect.POLLIN)], self.timeout or self.socket.gettimeout()) if not L: self.handle_timeout() else: self._handle_request_noblock()
def handle_request(self): L = coselect.poll_list( [(self, coselect.POLLIN)], self.timeout or self.socket.gettimeout()) if not L: self.handle_timeout() else: self._handle_request_noblock()
def serve_forever(self, poll_interval=0.5): while True: A, B = self.fileno(), self.__shut[1].fileno() for S, E in coselect.poll_list([(A, coselect.POLLIN), (B, coselect.POLLIN)]): if S == B: self.__shut[1].recv(100) return elif S == A: self._handle_request_noblock()
def serve_forever(self, poll_interval=0.5): while True: A, B = self.fileno(), self.__shut[1].fileno() for S, E in coselect.poll_list( [(A, coselect.POLLIN), (B, coselect.POLLIN)]): if S == B: self.__shut[1].recv(100) return elif S == A: self._handle_request_noblock()