SwarmMember.py 文件源码

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

项目:PyPPSPP 作者: justas- 项目源码 文件源码
def SendAndAccount(self, binary_data):
        # Keep this check!
        if self._logger.isEnabledFor(logging.DEBUG):
            logging.debug("!! Sending BIN data: {0}".format(binascii.hexlify(binary_data)))

        datalen = len(binary_data)

        if self._is_udp:
            self._swarm.SendData(self.ip_address, self.udp_port, binary_data)
        else:
            # Prevent crashes when TCP connection is already removed, but some sending is still pending
            if self._proto is not None:
                self._proto.send_data(binary_data)
                self._swarm._all_data_tx += datalen
            else:
                return  # No need to increase sent data counter...

        self._total_data_tx += datalen
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号