Esempio n. 1
0
    def __init__(
        self,
        host,
        port,
        app,
        handler=None,
        passthrough_errors=False,
        ssl_context=None,
        fd=None,
    ):
        if handler is None:
            handler = WebSocketHandler

        ThreadedWSGIServer.__init__(
            self,
            host,
            port,
            app,
            handler=handler,
            passthrough_errors=passthrough_errors,
            ssl_context=ssl_context,
            fd=fd,
        )
Esempio n. 2
0
    def __init__(self,
                 host: str,
                 port: int,
                 event_queue: queue.Queue,
                 handler: t.Optional[t.Type["AgentHandler"]] = AgentHandler,
                 passthrough_errors: bool = False,
                 ssl_context: t.Optional[_TSSLContextArg] = None,
                 fd: t.Optional[int] = None,
                 ) -> None:

        BaseThread.__init__(self)
        app = None
        WSGIServer.__init__(self,
                            host,
                            port,
                            app,
                            handler,
                            passthrough_errors,
                            ssl_context,
                            fd)

        self._lock = threading.RLock()
        self.event_queue = event_queue
        self.start()