commit | 4ec060ad28eacd0f80a9ee74d44a1f86553f566d | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Wed Aug 21 20:11:55 1996 +0000 |
committer | Guido van Rossum <guido@python.org> | Wed Aug 21 20:11:55 1996 +0000 |
tree | 27a188224f3dd19a382f84bbeb76f2e98c57f5a6 | |
parent | 171191efb292cb731d7c8fd8bd7d0b1f550948f5 [diff] |
unicast pendant for broadcast.py
diff --git a/Demo/sockets/unicast.py b/Demo/sockets/unicast.py new file mode 100644 index 0000000..1e9caeb --- /dev/null +++ b/Demo/sockets/unicast.py
@@ -0,0 +1,16 @@ +# Send UDP broadcast packets + +MYPORT = 50000 + +import sys, time +from socket import * + +s = socket(AF_INET, SOCK_DGRAM) +s.bind(('', 0)) + +while 1: + data = `time.time()` + '\n' + s.sendto(data, ('', MYPORT)) + time.sleep(2) + +