Skip to content

Instantly share code, notes, and snippets.

@pingswept
Created November 21, 2022 19:06
Show Gist options
  • Save pingswept/82b22985bec89eb36ece87ffd5bdbe0c to your computer and use it in GitHub Desktop.
Save pingswept/82b22985bec89eb36ece87ffd5bdbe0c to your computer and use it in GitHub Desktop.
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('', 5000))
while True:
data, addr = sock.recvfrom(4096)
print('got packet: %s from $s' % data, addr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment