python学习之网络编程
摘要:
socket模块小型服务器 1 import socket 2 3 s = socket.socket() 4 5 host = socket.gethostname() 6 port = 5000 7 s.bind((host, port)) 8 s.listen(5) 9 10 while True:11 c, addr = s.accept() ##(clinet, address)12 print 'get collection from ', addr13 c.send('Thank you for connecting')14 c.close... 阅读全文
posted @ 2012-06-02 11:32 huhuchen 阅读(215) 评论(0) 推荐(0) 编辑