Last active
December 1, 2016 20:37
-
-
Save pc-coholic/103a3ce298a3556a8b45a747eca841cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
UDP_IP = "0.0.0.0" | |
UDP_PORT = 2080 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind((UDP_IP, UDP_PORT)) | |
while True: | |
data, addr = sock.recvfrom(1024) | |
print "received from:", addr[0], addr[1] | |
print "received message:", data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment