Initial revision

This commit is contained in:
Guido van Rossum 1992-05-19 13:52:02 +00:00
parent c99a4f900d
commit b83ec8f58d
5 changed files with 243 additions and 0 deletions

17
Demo/sockets/broadcast.py Executable file
View file

@ -0,0 +1,17 @@
# Send UDP broadcast packets
MYPORT = 50000
import sys, time
from socket import *
s = socket(AF_INET, SOCK_DGRAM)
s.bind('', 0)
s.allowbroadcast(1)
while 1:
data = `time.time()` + '\n'
s.sendto(data, ('<broadcast>', MYPORT))
time.sleep(2)