File: class/Workbook/Examples/Lecture14/echoclient.py

from socket import *
HOST = 'localhost'      # the remote host name
PORT = 50007                # same port used by the server
s = socket(AF_INET, SOCK_STREAM)
s.connect((HOST, PORT))
s.send('Hello, world')
data = s.recv(1024)
s.close()
print 'Received', `data`



[Home page] Books Code Blog Python Author Train Find ©M.Lutz