Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
python
/
cpython2
/
a849b834f1e86bec20027654c91bb4cc74de5c8d
/
.
/
Demo
/
sockets
/
radio.py
blob: 4bb55ff9951e3c6f71d71da206cf64f5bd7037d0 [
file
] [
log
] [
blame
]
# 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
=
s
.
recv
(
1500
)
sys
.
stdout
.
write
(
data
)