08 2015 档案

摘要:asyncore库是python的一个标准库,它是一个异步socket的包装。我们操作网络的时候可以直接使用socket等底层的库,但是asyncore使得我们可以更加方便的操作网络,避免直接使用socket,select,poll等工具时需要面对的复杂。这个库很简单,包含了一个函数和一个类:* l... 阅读全文
posted @ 2015-08-18 11:17 arhatlohan 阅读(909) 评论(0) 推荐(1)
摘要:安装pip:apt-get install python-setuptoolseasy_install pippip install xxxx 阅读全文
posted @ 2015-08-17 21:29 arhatlohan 阅读(10373) 评论(0) 推荐(0)
摘要:import os import socketimport threadingimport SocketServerSERVER_HOST = 'localhost'SERVER_PORT = 0 #tells the kernel to pick up a port dynamicallyBUF_... 阅读全文
posted @ 2015-08-15 21:30 arhatlohan 阅读(360) 评论(0) 推荐(0)
摘要:Exception happened during processing of request from ('127.0.0.1', 65066)Traceback (most recent call last): File "C:\Python27\lib\SocketServer.py", l... 阅读全文
posted @ 2015-08-15 21:29 arhatlohan 阅读(2660) 评论(0) 推荐(0)
摘要:Server:import socketimport sysimport argparsehost = 'localhost'data_payload = 2048backlog = 5def echo_server(port): '''A simple echo server''' #Create... 阅读全文
posted @ 2015-08-15 20:13 arhatlohan 阅读(449) 评论(0) 推荐(0)