Sign in
android
/
device
/
linaro
/
hikey
/
82c8071
/
.
/
uefi
/
linaro-edk2
/
AppPkg
/
Applications
/
Python
/
Python-2.7.2
/
Demo
/
sockets
/
unicast.py
blob: 9d36f45f979d498f0dd91a77eed2c9e1e6462d36 [
file
] [
log
] [
blame
]
# Send UDP broadcast packets
MYPORT
=
50000
import
sys
,
time
from
socket
import
*
s
=
socket
(
AF_INET
,
SOCK_DGRAM
)
s
.
bind
((
''
,
0
))
while
1
:
data
=
repr
(
time
.
time
())
+
'\n'
s
.
sendto
(
data
,
(
''
,
MYPORT
))
time
.
sleep
(
2
)