コード例 #1
0
def createDeliverUpdateMsg(Start, SpecifiedNumber, WindowSize):
    seek = ab_pb2.SeekInfo()
    startVal = seek.__getattribute__(Start)
    seekInfo = ab_pb2.SeekInfo(Start=startVal,
                               SpecifiedNumber=SpecifiedNumber,
                               WindowSize=WindowSize)
    deliverUpdateMsg = ab_pb2.DeliverUpdate(Seek=seekInfo)
    return deliverUpdateMsg
コード例 #2
0
 def sendAcknowledgment(self, blockNum):
     deliverUpdateMsg = ab_pb2.DeliverUpdate(
         Acknowledgement=ab_pb2.Acknowledgement(Number=blockNum))
     self.sendQueue.put(deliverUpdateMsg)
コード例 #3
0
 def seekToBlock(self, blockNum):
     deliverUpdateMsg = ab_pb2.DeliverUpdate()
     deliverUpdateMsg.CopyFrom(self.deliverUpdateMsg)
     deliverUpdateMsg.Seek.SpecifiedNumber = blockNum
     self.sendQueue.put(deliverUpdateMsg)