• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python client.ClientHTTP类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中neubot.http.client.ClientHTTP的典型用法代码示例。如果您正苦于以下问题:Python ClientHTTP类的具体用法?Python ClientHTTP怎么用?Python ClientHTTP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ClientHTTP类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, poller):
     ClientHTTP.__init__(self, poller)
     STATE.update("test_name", "speedtest")
     self.child = None
     self.streams = collections.deque()
     self.finished = False
     self.state = None
开发者ID:DavideAllavena,项目名称:neubot,代码行数:7,代码来源:client.py


示例2: __init__

 def __init__(self, ctx):
     ''' Download a file '''
     self.ctx = ctx
     ClientHTTP.__init__(self, POLLER)
     self.configure(CONFIG.copy())
     logging.debug('runner_dload: GET %s', self.ctx['uri'])
     self.connect_uri(self.ctx['uri'])
开发者ID:EverlastingFire,项目名称:neubot,代码行数:7,代码来源:runner_dload.py


示例3: __init__

 def __init__(self, ctx):
     """ Download a file """
     self.ctx = ctx
     ClientHTTP.__init__(self, POLLER)
     self.configure(CONFIG.copy())
     logging.info("runner_dload: connecting to %s", self.ctx["uri"])
     self.connect_uri(self.ctx["uri"])
开发者ID:felipebusnello,项目名称:neubot,代码行数:7,代码来源:runner_dload.py


示例4: connect_uri

 def connect_uri(self, uri=None, count=None):
     if not uri:
         uri = self.conf.get("speedtest.client.uri",
           "http://neubot.blupixel.net/")
     if not count:
         count = self.conf.get("speedtest.client.nconn", 1)
     LOG.info("* speedtest with %s" % uri)
     ClientHTTP.connect_uri(self, uri, count)
开发者ID:ClaudioArtusio,项目名称:neubot,代码行数:8,代码来源:client.py


示例5: connect_uri

    def connect_uri(self, uri=None, count=None):
        if not uri:
            address = self.conf["bittorrent.address"]
            port = self.conf["bittorrent.negotiate.port"]
            uri = "http://%s:%s/" % (address, port)

        LOG.start("BitTorrent: connecting to %s" % uri)

        ClientHTTP.connect_uri(self, uri, 1)
开发者ID:DavideAllavena,项目名称:neubot,代码行数:9,代码来源:client.py


示例6: connect_uri

    def connect_uri(self, uri=None, count=None):
        if not uri:
            address = self.conf["bittorrent.address"]
            port = self.conf["bittorrent.negotiate.port"]
            uri = "http://%s:%s/" % (address, port)

        logging.info("BitTorrent: connecting to %s in progress...", uri)

        ClientHTTP.connect_uri(self, uri, 1)
开发者ID:felipebusnello,项目名称:neubot,代码行数:9,代码来源:client.py


示例7: __init__

 def __init__(self, poller):
     ClientHTTP.__init__(self, poller)
     STATE.update("test_latency", "---", publish=False)
     STATE.update("test_download", "---", publish=False)
     STATE.update("test_upload", "---", publish=False)
     STATE.update("test_name", "speedtest")
     self.child = None
     self.streams = collections.deque()
     self.finished = False
     self.state = None
开发者ID:felipebusnello,项目名称:neubot,代码行数:10,代码来源:client.py


示例8: __init__

    def __init__(self, poller, parent, rates):
        ClientHTTP.__init__(self, poller)
        self.parent = parent
        self.rates = rates

        STATE.update("test_latency", "---", publish=False)
        STATE.update("test_download", "---", publish=False)
        STATE.update("test_upload", "N/A", publish=False)
        STATE.update("test_progress", "0%", publish=False)
        STATE.update("test_name", "dash", publish=False)
        STATE.update("test")

        self.iteration = 0
        self.rate_kbit = 0
        self.speed_kbit = 100
        self.saved_ticks = 0.0
        self.saved_cnt = 0
        self.saved_times = 0
开发者ID:neubot,项目名称:neubot,代码行数:18,代码来源:client_smpl.py


示例9: __init__

    def __init__(self, poller):
        ClientHTTP.__init__(self, poller)

        STATE.update("test_latency", "---", publish=False)
        STATE.update("test_download", "---", publish=False)
        STATE.update("test_upload", "---", publish=False)
        STATE.update("test_progress", "0%", publish=False)
        STATE.update("test_name", "dash")

        self.state = STATE_NEGOTIATE

        self.stream = None
        self.measurements = []
        self.client = None

        self.authorization = ""
        self.real_address = ""
        self.queue_pos = 0
        self.unchoked = False

        self.iterations = 0
开发者ID:EverlastingFire,项目名称:neubot,代码行数:21,代码来源:client_negotiate.py


示例10: connect

 def connect(self, endpoint, count=1):
     if count != 1:
         raise RuntimeError("dash: invalid count")
     logging.info("dash: negotiate with: %s",
         utils_net.format_epnt(endpoint))
     ClientHTTP.connect(self, endpoint, count)
开发者ID:EverlastingFire,项目名称:neubot,代码行数:6,代码来源:client_negotiate.py


示例11: configure

 def configure(self, conf, measurer=None):
     if measurer:
         LOG.info("* speedtest: ignoring upstream measurer")
     ClientHTTP.configure(self, conf, self.measurer)
开发者ID:ClaudioArtusio,项目名称:neubot,代码行数:4,代码来源:client.py


示例12: __init__

 def __init__(self, poller):
     ClientHTTP.__init__(self, poller)
     self.timestamp = 0
     self.uri = ""
     self.stop = False
开发者ID:ClaudioArtusio,项目名称:neubot,代码行数:5,代码来源:client.py



注:本文中的neubot.http.client.ClientHTTP类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python message.Message类代码示例发布时间:2022-05-27
下一篇:
Python database.DATABASE类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap