摘要: import socket def handle_request(client): buf=client.recv(1024) ckient.send('HTTP/1.1 200 OK\r\n\r\n') client.send('Hello,world') def main(): sock=socket.socket(socket.AF_INET,so... 阅读全文
posted @ 2017-04-15 14:33 ezway 阅读(296) 评论(0) 推荐(0)
摘要: server #! bin/usr/evn python # -*- coding:utf-8 -*- import socket sk=socket.socket() sk.bind(('127.0.0.2',888,)) sk.listen(5) while 1: con,addr=sk.accept() con.sendall(bytes('welcome',encodi... 阅读全文
posted @ 2017-04-15 14:13 ezway 阅读(186) 评论(0) 推荐(0)