server.py
很好,我使用数组发送数据:
for i in range(0,len(outputdata)):
connectionSocket.send(outputdata[i])
connectionSocket.close()
但我的客户不工作(不打印):
#import socket module
from socket import *
serverName = '127.0.0.1'
serverPort = 9999
clientSocket = socket(AF_INET,SOCK_STREAM)
clientSocket.connect((serverName,serverPort))
request = raw_input('Input the filename:')
clientSocket.send(request)
while (clientSocket.recv(1024)):
print clientSocket.recv(1024)
clientSocket.close()
为什么这不起作用?