|
Last change
on this file since 1538 was 2, checked in by Yuri Dario, 15 years ago |
|
Initial import for vendor code.
|
-
Property svn:eol-style
set to
native
|
|
File size:
287 bytes
|
| Line | |
|---|
| 1 | # Receive UDP packets transmitted by a broadcasting service
|
|---|
| 2 |
|
|---|
| 3 | MYPORT = 50000
|
|---|
| 4 |
|
|---|
| 5 | import sys
|
|---|
| 6 | from socket import *
|
|---|
| 7 |
|
|---|
| 8 | s = socket(AF_INET, SOCK_DGRAM)
|
|---|
| 9 | s.bind(('', MYPORT))
|
|---|
| 10 |
|
|---|
| 11 | while 1:
|
|---|
| 12 | data, wherefrom = s.recvfrom(1500, 0)
|
|---|
| 13 | sys.stderr.write(repr(wherefrom) + '\n')
|
|---|
| 14 | sys.stdout.write(data)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.