summaryrefslogtreecommitdiffstats
path: root/Demo/sockets/unicast.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/sockets/unicast.py')
-rw-r--r--Demo/sockets/unicast.py16
1 files changed, 16 insertions, 0 deletions
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)
+
+