source: python/trunk/Demo/sockets/unicast.py@ 394

Last change on this file since 394 was 2, checked in by Yuri Dario, 15 years ago

Initial import for vendor code.

  • Property svn:eol-style set to native
File size: 230 bytes
Line 
1# Send UDP broadcast packets
2
3MYPORT = 50000
4
5import sys, time
6from socket import *
7
8s = socket(AF_INET, SOCK_DGRAM)
9s.bind(('', 0))
10
11while 1:
12 data = repr(time.time()) + '\n'
13 s.sendto(data, ('', MYPORT))
14 time.sleep(2)
Note: See TracBrowser for help on using the repository browser.