Created
October 31, 2013 18:22
-
-
Save studiawan/7254449 to your computer and use it in GitHub Desktop.
UDP client with connect()
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 characters
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