标签:close usr connect host print not python port recv
#!/usr/bin/env python
#
#-*-coding:utf-8-*-
#
from socket import *
HOST = ‘192.168.43.90‘ # // need to change ip
PORT = 6666;
BUFSIZE = 1024;
ADDR=(HOST,PORT)
tcpCliSock = socket(AF_INET,SOCK_STREAM)
tcpCliSock.connect(ADDR)
while True:
print"socket client start !!"
data = raw_input (‘>‘)
if not data:
break
tcpCliSock.send(data)
#data = tcpCliSock.recv(BUFSIZE)
#if not data:
#break
print data
tcpCliSock.close()
标签:close usr connect host print not python port recv
原文地址:http://www.cnblogs.com/123talents/p/7522428.html