]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Allow broadcast using setsockopt()
authorGuido van Rossum <guido@python.org>
Tue, 8 Sep 1992 21:20:12 +0000 (21:20 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 8 Sep 1992 21:20:12 +0000 (21:20 +0000)
Demo/sockets/broadcast.py

index 9ed900f0c6f4a11b7976f5a95444c625f58b0fd9..e7e6b9b1d1def94c01aaeef374acb7d4987cbf1c 100755 (executable)
@@ -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'