diff options
author | Guido van Rossum <guido@python.org> | 1992-09-08 21:20:12 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-09-08 21:20:12 (GMT) |
commit | 0aead9f1bac4f9fd962fedff2e377d69bb33fee6 (patch) | |
tree | 457a65e5e9bf61f1de771f39812b389bb7ddcc25 /Demo/sockets/broadcast.py | |
parent | 4fab6a5b0bfd13a11833adde57b9c0ef97c9853c (diff) | |
download | cpython-0aead9f1bac4f9fd962fedff2e377d69bb33fee6.zip cpython-0aead9f1bac4f9fd962fedff2e377d69bb33fee6.tar.gz cpython-0aead9f1bac4f9fd962fedff2e377d69bb33fee6.tar.bz2 |
Allow broadcast using setsockopt()
Diffstat (limited to 'Demo/sockets/broadcast.py')
-rwxr-xr-x | Demo/sockets/broadcast.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Demo/sockets/broadcast.py b/Demo/sockets/broadcast.py index 9ed900f..e7e6b9b 100755 --- a/Demo/sockets/broadcast.py +++ b/Demo/sockets/broadcast.py @@ -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' |