# -*- coding:utf-8 -*-
'''
TCP协议
socket 客户端
'''
import socket
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) #创建socket实例
sock.connect(("127.0.0.1",8000))
while True:
recvData=sock.recv(512)
print(recvData)
if recvData == "break":
break
sendData = raw_input(">>>")
sock.send(sendData)
if sendData == 'break':
break
sock.close()