Beispiel #1
0
 def send(self, op_code, payload):
     self.sequence_id = (self.sequence_id + 1) % 1000
     self.header.update({
         'sequence_id': self.sequence_id,
         'op_code': op_code,
     })
     packet = Protocol.assemble_packet(self.header, payload)
     logger.debug('Sending Packet: ' + packet.hex())
     packet = Protocol.encode(packet)
     logger.debug('Sending Header:  ' + str(self.header))
     logger.debug('Sending Payload: ' + str(payload))
     self.ss.sendto(packet,
                    (Network.BROADCAST_ADDR, Network.UDP_SEND_TO_PORT))