Skip to content

Instantly share code, notes, and snippets.

@donalmacc
Created July 20, 2012 00:37
Show Gist options
  • Save donalmacc/3147929 to your computer and use it in GitHub Desktop.
Save donalmacc/3147929 to your computer and use it in GitHub Desktop.
Sender
# Sender client
import socket
HOST = '127.0.0.1' # The remote host
PORT = 1756 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
print"Please enter your message:"
msg = raw_input()
s.sendall(msg)
s.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment