From 4ec060ad28eacd0f80a9ee74d44a1f86553f566d Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 21 Aug 1996 20:11:55 +0000 Subject: [PATCH] unicast pendant for broadcast.py --- Demo/sockets/unicast.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Demo/sockets/unicast.py diff --git a/Demo/sockets/unicast.py b/Demo/sockets/unicast.py new file mode 100644 index 00000000000..1e9caebd2ac --- /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) + +