Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
python
/
cpython3
/
21974798ced0eafef0b331a69f96222400859232
/
.
/
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
)