generic.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:dcos 作者: dcos 项目源码 文件源码
def __init__(self, handler_class, path, keyfile=None, certfile=None):
        """Initialize new UnixSocketHTTPEndpoint object

        Args:
            handler_class (obj): a request handler class that will be handling
                requests received by internal httpd server
            path (str): Unix socket path, that internal httpd server will listen
                on
        """
        if certfile is not None and keyfile is not None:
            endpoint_id = "https://{}".format(path)
        else:
            endpoint_id = "http://{}".format(path)
        super().__init__(endpoint_id)

        self._context.data['socket_path'] = path
        self._context.data['certfile'] = certfile
        self._context.data['keyfile'] = keyfile

        self._handler_class = handler_class

        self.__cleanup_stale_socket(path)
        self.__setup_httpd_thread(path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号