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