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

浙公网安备 33010602011771号