您现在的位置是:网站首页> 编程资料编程资料
python实现Linux异步epoll代码_linux shell_
2023-05-26
408人已围观
简介 python实现Linux异步epoll代码_linux shell_
复制代码 代码如下:
import socket
import select
if __name__=="__main__":
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.bind(("",20123))
s.listen(10)
epoll=select.epoll()
print s.fileno()
print select.EPOLLIN|select.EPOLLET
epoll.register(s.fileno(),select.EPOLLIN|select.EPOLLET)
while 1:
epoll_list=epoll.poll()
for fd,events in epoll_list:
print fd
print events
if fd==s.fileno():
conn,addr=s.accept()
print 123
您可能感兴趣的文章:
相关内容
- shell实现字符编码转换工具分享_linux shell_
- shell编程之实现windows回收站功能分享_linux shell_
- linux数据库备份并通过ftp上传脚本分享_linux shell_
- shell学习教程获取命令行参数示例_linux shell_
- linux删除无效链接文件脚本分享_linux shell_
- nginx日志切割脚本分享_linux shell_
- Shell编程之Shell变量学习总结_linux shell_
- 使用curl递归下载软件脚本分享_linux shell_
- mysql源码安装脚本分享_linux shell_
- 从apnic提取ip信息脚本分享_linux shell_
