Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created October 31, 2013 18:22
Show Gist options
  • Save studiawan/7254449 to your computer and use it in GitHub Desktop.
Save studiawan/7254449 to your computer and use it in GitHub Desktop.
UDP client with connect()
import socket
server_address = ('127.0.0.1', 5000)
client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client_socket.connect(server_address)
message = 'Hi ...'
client_socket.send(message)
recv_message = client_socket.recv(1024)
print recv_message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment