socket ready: udp server, readme

This commit is contained in:
Mari Wahl 2014-12-16 23:58:01 -05:00
parent 183bf44e32
commit f4d51beb08
4 changed files with 707 additions and 2 deletions

View file

@ -0,0 +1,22 @@
#!/usr/bin/env python
__author__ = "bt3"
import socket
BIND_IP = '0.0.0.0'
BIND_PORT = 9000
def udp_server():
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server.bind(( BIND_IP, BIND_PORT))
print "Waiting on port: " + str(BIND_PORT)
while 1:
data, addr = server.recvfrom(1024)
print data
if __name__ == '__main__':
udp_server()