text: import socket
  import struct
  
  MCAST_GRP = '239.255.43.21'
  MCAST_PORT = 45454
  
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  # sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
  # sock.bind((MCAST_GRP, MCAST_PORT))
  sock.bind(('', MCAST_PORT))  # use MCAST_GRP instead of '' to listen only
                               # to MCAST_GRP, not all groups on MCAST_PORT
  mreq = struct.pack("4sl", socket.inet_aton(MCAST_GRP), socket.INADDR_ANY)
  
  sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
  
  while True:
    print sock.recv(10240)
  