def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True): HTTPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate) ThreadingMixIn.__init__(self)
def __init__(self, ip, port, bf_callback): self.m_ip = ip self.m_port = port self.m_bf_callback = bf_callback ThreadingMixIn.__init__(self) HTTPServer.__init__(self, (self.m_ip, self.m_port), MiddlewareHttpHandler) self.m_thread = threading.Thread(target = self.run_server)
def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True): HTTPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate) ThreadingMixIn.__init__(self) def serve_forever(self, poll_interval=0.1): super().serve_forever(poll_interval)
def __init__(self, capture_path, server_address, RequestHandlerClass, bind_and_activate=True): HTTPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate) ThreadingMixIn.__init__(self) try: # verifies whether is a webcam capture_path = int(capture_path) except TypeError: pass self._capture_path = capture_path fps = 30 self.read_delay = 1. / fps self._lock = threading.Lock() self._camera = cv2.VideoCapture() self._camera.set(cv2.CAP_PROP_FRAME_WIDTH, 640) self._camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
def __init__(self, ip, port): self.m_ip = ip self.m_port = port self.transaction_ctrl = TransactionController(self.send_response) self.m_request_list = {} self.m_notification_list = {} self.m_cRes_packets_wainting = {} self.m_timer_list = {} ThreadingMixIn.__init__(self) HTTPServer.__init__(self, (self.m_ip, self.m_port), AcsHttpRequestHandler) print('INFO : Launching ACS HTTP server on ' + str(self.m_ip) + ':' + str(self.m_port)) self.serve_forever()
def __init__(self, capture_path, server_address, loop_play, RequestHandlerClass, bind_and_activate=True): HTTPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate) ThreadingMixIn.__init__(self) try: # verifies whether is a webcam capture_path = int(capture_path) except TypeError: pass except ValueError: pass self._capture_path = capture_path fps = 30 self.read_delay = 1. / fps self._lock = threading.Lock() self._camera = cv2.VideoCapture(capture_path) self.loop_play = loop_play
def __init__(self, server_address): ThreadingMixIn.__init__(self) TCPServer.__init__(self, server_address, NetflixHttpRequestHandler) # Define shared members self.netflix_session = NetflixSession()
def process_request_thread(self): while True: ThreadingMixIn.process_request_thread(self, *self.requests.get())
def process_request_thread(self): """ obtain request from queue instead of directly from server socket """ while True: ThreadingMixIn.process_request_thread(self, *self.requests.get())
def process_request(self, request, client_address): """Override process_request to implement a counter""" self.handler_id += 1 ThreadingMixIn.process_request(self, request, client_address)
def process_request_thread(self, request, client_address): ThreadingMixIn.process_request_thread(self, request, client_address)
def __init__(self, numThreads=10): self.numThreads=numThreads ThreadingMixIn.__init__(self)
def thread_main_loop(self): while True: # get a request from queue to process ThreadingMixIn.process_request_thread(self, *self.requests.get())