Skip to content

Instantly share code, notes, and snippets.

@yazgoo
Created November 14, 2017 09:54
Show Gist options
  • Select an option

  • Save yazgoo/cb698bc13bd2a818c705cf3ab460b0de to your computer and use it in GitHub Desktop.

Select an option

Save yazgoo/cb698bc13bd2a818c705cf3ab460b0de to your computer and use it in GitHub Desktop.
import socket
port_number = 4242
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(('0.0.0.0', port_number))
print "UDPServer Waiting for client on port", port_number
while True: print server_socket.recvfrom(1024)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment