generic.py 文件源码

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

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

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

        self._context.data['listen_ip'] = ip
        self._context.data['listen_port'] = port
        self._context.data['certfile'] = certfile
        self._context.data['keyfile'] = keyfile

        self._handler_class = handler_class

        self.__setup_httpd_thread(ip, port)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号