]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/radio.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Demo / sockets / radio.py
CommitLineData
4710c53d 1# Receive UDP packets transmitted by a broadcasting service\r
2\r
3MYPORT = 50000\r
4\r
5import sys\r
6from socket import *\r
7\r
8s = socket(AF_INET, SOCK_DGRAM)\r
9s.bind(('', MYPORT))\r
10\r
11while 1:\r
12 data, wherefrom = s.recvfrom(1500, 0)\r
13 sys.stderr.write(repr(wherefrom) + '\n')\r
14 sys.stdout.write(data)\r