当前位置: 首页>>代码示例>>Python>>正文


Python PiecePicker.got_have方法代码示例

本文整理汇总了Python中BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker.got_have方法的典型用法代码示例。如果您正苦于以下问题:Python PiecePicker.got_have方法的具体用法?Python PiecePicker.got_have怎么用?Python PiecePicker.got_have使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker的用法示例。


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

示例1: got_have

# 需要导入模块: from BaseLib.Core.BitTornado.BT1.PiecePicker import PiecePicker [as 别名]
# 或者: from BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker import got_have [as 别名]
    def got_have(self, piece, connection=None):
        # if DEBUG:
        #     print >>sys.stderr,"PiecePickerStreaming: got_have:",piece
        self.maxhave = max(self.maxhave, piece)
        PiecePicker.got_have(self, piece, connection)
        if self.transporter:
            self.transporter.got_have(piece)

        if self.is_interesting(piece) and connection:
            self.peer_connections[connection]["interesting"][piece] = 1
开发者ID:smoothit,项目名称:smoothit-client,代码行数:12,代码来源:PiecePickerStreaming.py

示例2: got_have

# 需要导入模块: from BaseLib.Core.BitTornado.BT1.PiecePicker import PiecePicker [as 别名]
# 或者: from BaseLib.Core.BitTornado.BT1.PiecePicker.PiecePicker import got_have [as 别名]
    def got_have(self, piece, connection=None):
        # if DEBUG:
        #     print >>sys.stderr,"PiecePickerStreaming: got_have:",piece
        self.maxhave = max(self.maxhave,piece)

        # Arno, 2010-04-15: STBSPEED Disabled, does nothing but stats.
        #if self.transporter:
        #    self.transporter.got_have( piece )
        PiecePicker.got_have(self,piece,connection)

        if self.is_interesting(piece):
            self.peer_connections[connection]["interesting"][piece] = 1
开发者ID:Swizec,项目名称:IJS-stuff,代码行数:14,代码来源:PiecePickerStreaming.py


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