blob: 4bb55ff9951e3c6f71d71da206cf64f5bd7037d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# 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)
|