sSock = socket(AF_INET, SOCK_STREAM) sSock.connect((serverHost, serverPort)) line = "" while line != 'bye': line = raw_input("Send to %s: " % (serverHost)) sSock.send(line+'n') data = sSock.recv(1024) print 'data'
sSock.shutdown(0) sSock.close()
Related Scripts with Example Source Code in same category :