#coding:utf-8
from socket import *
#开启ip和端口
ip_port = ("192.168.1.103",8088)
print ip_port sockobj = socket(AF_INET,SOCK_STREAM)
sockobj.bind(ip_port)
sockobj.listen(128) #同时允许128个链接 while True:
connection,address=sockobj.accept()
print"connect by",address
while True:
data = connection.recv(1024)
if not data:
break
connection.send('echo'+data)
connection.close()
print "closed to",address
05-11 13:49