# Echo server program import socket import struct HOST = '' # Symbolic name meaning the local host PORT = 15922 # Arbitrary non-privileged port mcast_adress = "227.234.253.9" s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((HOST, PORT)) mreq = struct.pack('4si', socket.inet_aton(mcast_adress), socket.INADDR_ANY) s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) data = s.recv(1024) if (data): print (data) s.close()