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
def sendAcknowledgment(self, blockNum): deliverUpdateMsg = ab_pb2.DeliverUpdate( Acknowledgement=ab_pb2.Acknowledgement(Number=blockNum)) self.sendQueue.put(deliverUpdateMsg)
def seekToBlock(self, blockNum): deliverUpdateMsg = ab_pb2.DeliverUpdate() deliverUpdateMsg.CopyFrom(self.deliverUpdateMsg) deliverUpdateMsg.Seek.SpecifiedNumber = blockNum self.sendQueue.put(deliverUpdateMsg)