repo.or.cz
/
python.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Minor fix for currentframe (SF #1652788).
[python.git]
/
Demo
/
sockets
/
unicast.py
blob
dd15e3c7b98fdd2b8b4c75d5f568b30c99d2fbba
1
# Send UDP broadcast packets
2
3
MYPORT
=
50000
4
5
import
sys
,
time
6
from
socket
import
*
7
8
s
=
socket
(
AF_INET
,
SOCK_DGRAM
)
9
s
.
bind
((
''
,
0
))
10
11
while
1
:
12
data
=
repr
(
time
.
time
()) +
'
\n
'
13
s
.
sendto
(
data
, (
''
,
MYPORT
))
14
time
.
sleep
(
2
)