Exemplo n.º 1
0
  def transfer (self, packet):
    def rx ():
      packet.mark(self.dstEnt) #FIXME: do this somewhere more convenient
      self.dstEnt.handle_rx(packet, self.dstPort)

    world.doLater(self.latency, rx)

    events.packet(self.srcEnt.name, self.dstEnt.name, packet, self.latency)
Exemplo n.º 2
0
 def transfer(self, packet):
     if random.random() >= self.drop:
         super(UnreliableCable, self).transfer(packet)
     else:
         events.packet(self.srcEnt.name,
                       self.dstEnt.name,
                       packet,
                       self.latency,
                       drop=True)
Exemplo n.º 3
0
 def transfer (self, packet):
   if random.random() >= self.drop:
     super(UnreliableCable, self).transfer(packet)
   else:
     events.packet(self.srcEnt.name, self.dstEnt.name, packet,
                   self.latency, drop=True)