Skip to content

Instantly share code, notes, and snippets.

@QZLin
Created April 27, 2022 09:13
Show Gist options
  • Save QZLin/7dcec08e16256e80a01401c137871175 to your computer and use it in GitHub Desktop.
Save QZLin/7dcec08e16256e80a01401c137871175 to your computer and use it in GitHub Desktop.
import socket
ip_port = ('', 9999)
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server.bind(ip_port)
while True:
data, addr = server.recvfrom(1024)
print('Received:', data.decode())
# server.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment