def sendingDATA(self, pack): packet4Bytes = pack.__serialize__() self.transport.write(packet4Bytes) print("ClientData Packet Sent") timer = Timer(Seconds(2),self.sendingDATA,pack) self.timers.append(timer) timer.start()
def shutdown(self): if len(self.packets) == 0: self.sendRIP() else: print(len(self.packets)) t = Timer(Seconds(2),self.shutdown) t.start()
def sendRIPACK(self): pack = PEEPPacket() pack.Type = 4 pack.SequenceNumber = 0 pack.Acknowledgement = 0 pack.Checksum = self.calculateChecksum(pack) packet4Bytes = pack.__serialize__() self.transport.write(packet4Bytes) print("RIP Packet Sent") rip_timer = Timer(Seconds(2),self.abort_connection) rip_timer.start()
def shutdown(self): if len(self.packets) == 0: self.sendRIP() else: timer = Timer(Seconds(2),self.shutdown) timer.start()