diff --git a/for_testing_multicast/peer.py b/for_testing_multicast/peer.py index 8a992ac..47622c9 100644 --- a/for_testing_multicast/peer.py +++ b/for_testing_multicast/peer.py @@ -26,6 +26,3 @@ sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq) data, addr = sock.recvfrom(1024) print(data) print(addr[0], addr[1]) - -time.sleep(3) -sock.sendto("hello world".encode('utf-8'), ("addr[0]", int(addr[1]))) diff --git a/squinnondation/peers.py b/squinnondation/peers.py index 31091e1..6523c7a 100644 --- a/squinnondation/peers.py +++ b/squinnondation/peers.py @@ -1030,7 +1030,7 @@ class User(Peer): """ Receive a packet from the multicast and translate it into a Python object. """ - data, addr = self.receive_raw_data() + data, addr = self.receive_multicast() peer = self.find_peer(addr[0], addr[1]) try: pkt = Packet.unmarshal(data) @@ -1147,7 +1147,7 @@ class PeerManager(Thread): self.last_neighbour = time.time() # For the multicast discovery : send a hello every minute. - if time.time() - self.last_multicast > 60: + if time.time() - self.last_multicast > 10: #60: self.user.send_hello_multicast() self.last_multicast = time.time()