mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Allow broadcast using setsockopt()
This commit is contained in:
parent
4fab6a5b0b
commit
0aead9f1ba
1 changed files with 2 additions and 1 deletions
|
@ -4,10 +4,11 @@ MYPORT = 50000
|
|||
|
||||
import sys, time
|
||||
from socket import *
|
||||
from SOCKET import *
|
||||
|
||||
s = socket(AF_INET, SOCK_DGRAM)
|
||||
s.bind('', 0)
|
||||
s.allowbroadcast(1)
|
||||
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
|
||||
|
||||
while 1:
|
||||
data = `time.time()` + '\n'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue