equal
deleted
inserted
replaced
624 |
624 |
625 |
625 |
626 class DNSOutgoing(object): |
626 class DNSOutgoing(object): |
627 """Object representation of an outgoing packet""" |
627 """Object representation of an outgoing packet""" |
628 |
628 |
629 def __init__(self, flags, multicast = 1): |
629 def __init__(self, flags, multicast=1): |
630 self.finished = 0 |
630 self.finished = 0 |
631 self.id = 0 |
631 self.id = 0 |
632 self.multicast = multicast |
632 self.multicast = multicast |
633 self.flags = flags |
633 self.flags = flags |
634 self.names = {} |
634 self.names = {} |
1527 |
1527 |
1528 if out is not None and out.answers: |
1528 if out is not None and out.answers: |
1529 out.id = msg.id |
1529 out.id = msg.id |
1530 self.send(out, addr, port) |
1530 self.send(out, addr, port) |
1531 |
1531 |
1532 def send(self, out, addr = _MDNS_ADDR, port = _MDNS_PORT): |
1532 def send(self, out, addr=_MDNS_ADDR, port=_MDNS_PORT): |
1533 """Sends an outgoing packet.""" |
1533 """Sends an outgoing packet.""" |
1534 # This is a quick test to see if we can parse the packets we generate |
1534 # This is a quick test to see if we can parse the packets we generate |
1535 #temp = DNSIncoming(out.packet()) |
1535 #temp = DNSIncoming(out.packet()) |
1536 try: |
1536 try: |
1537 bytes_sent = self.socket.sendto(out.packet(), 0, (addr, port)) |
1537 bytes_sent = self.socket.sendto(out.packet(), 0, (addr, port)) |