Using Linux and Python, I want to send some data with broadcast:
d = b'109u433279423423423'
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(d, 0, ('192.168.0.255', 9))
I launch this script under root and get this error:
s.sendto(d, 0, ('192.168.0.255', 9)) socket.error: [Errno 13]
Permission denied
What is wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…