# broadcast_recieve.py

from socket import *

# 创建套接字
s = socket(AF_INET, SOCK_DGRAM)

s.setsockopt(SOL_SOCKET, SO_BROADCAST, True)

# 选择接收地址
s.bind(('0.0.0.0',9898))

while True:
	msg, addr = s.recvfrom(1024)
	print(msg.decode())
cba1daa01539e7767b9143ffb01530794366f6aa
<mask token>

<mask token>
s.setsockopt(SOL_SOCKET, SO_BROADCAST, True)
s.bind(('0.0.0.0', 9898))
while True:
    msg, addr = s.recvfrom(1024)
    print(msg.decode())

<mask token>
s = socket(AF_INET, SOCK_DGRAM)
s.setsockopt(SOL_SOCKET, SO_BROADCAST, True)
s.bind(('0.0.0.0', 9898))
while True:
    msg, addr = s.recvfrom(1024)
    print(msg.decode())

from socket import *
s = socket(AF_INET, SOCK_DGRAM)
s.setsockopt(SOL_SOCKET, SO_BROADCAST, True)
s.bind(('0.0.0.0', 9898))
while True:
    msg, addr = s.recvfrom(1024)
    print(msg.decode())

# broadcast_recieve.py

from socket import *

# 创建套接字
s = socket(AF_INET, SOCK_DGRAM)

s.setsockopt(SOL_SOCKET, SO_BROADCAST, True)

# 选择接收地址
s.bind(('0.0.0.0',9898))

while True:
	msg, addr = s.recvfrom(1024)
	print(msg.decode())