Created
November 12, 2018 12:14
-
-
Save yychen/a0aca434fdf6502d1497bf2ce519a124 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
#!/usr/bin/env python3 | |
import socket | |
import time | |
UDP_HOST = '0.0.0.0' | |
UDP_PORT = 3838 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind((UDP_HOST, UDP_PORT)) | |
while True: | |
data, addr = sock.recvfrom(1024) | |
print('Received: ', data) | |
time.sleep(0.05) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment