1 将下面代码拷贝到一个文件,命名为asyncore.py
复制代码 代码如下:import socketimport selectimport sys
def ds_asyncore(addr,callback,timeout=5): s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(addr) r,w,e = select.select([s],[],[],timeout) if r: respose_data=s.recv(1024) callback(respos
1