목록2020/08/27 (1)
Self-Improvement
[Python socket] Multicast Request/Receive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 from socket import * # Multicast IP, Port MCAST_GRP = '224.0.0.251' MCAST_PORT = 5353 # UDP Socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # on this port, receives ALL multicast groups sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(('', MCAST_PORT)) # Host IP Get host = socket.gethostbyname(socke..
프로그래밍/Python
2020. 8. 27. 15:00