# -*- coding : UTF-8 -*-
import socket
HOST_NAME = '255.255.255.255'
PORT = 9750 # 0x2616
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(b"Hello, UDP BroadCast", (HOST_NAME, PORT))
|