home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Big Green CD 8
/
BGCD_8_Dev.iso
/
OPENSTEP
/
Languages
/
Python
/
python-14-src
/
Demo
/
sockets
/
radio.py
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Python Source
|
1997-01-17
|
274 b
|
15 lines
# Receive UDP packets transmitted by a broadcasting service
MYPORT = 50000
import sys
from socket import *
s = socket(AF_INET, SOCK_DGRAM)
s.bind(('', MYPORT))
while 1:
data, wherefrom = s.recvfrom(1500, 0)
sys.stderr.write(`wherefrom` + '\n')
sys.stdout.write(data)