Created
July 8, 2019 13:08
-
-
Save corenting/edbc0110621bd1331d4e49698b6ed25f to your computer and use it in GitHub Desktop.
Revisions
-
corenting created this gist
Jul 8, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/env python3 # encoding: utf-8 import datetime import socket UDP_IP = "127.0.0.1" UDP_PORT = 8125 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind((UDP_IP, UDP_PORT)) while True: data, addr = sock.recvfrom(1024) print(datetime.datetime.now(), data)