Beispiel #1
0
 def _send(self, message):
     """Build and send packet.
     """
     p = Packet()
     p.payload = message
     self.proto.send(p)
     return
Beispiel #2
0
 def on_new_packet(self, p, proto):
     now = time.time()
     print '%.6f: RECEIVER DATA:' % now, repr(p), repr(p.src_addr), repr(p.recv_addr)
     if p.id == 0x04:
         return
     pkt = Packet()
     pkt.id = 0x04
     t = '%.6f:' % now
     pkt.payload = t[6:] + p.payload
     proto.send(pkt) #, p.src_addr)
     return