网站首页 语言 会计 互联网计算机 医学 学历 职场 文艺体育 范文
当前位置:学识谷 > 计算机 > 操作系统

使用python实现Linux异步epoll的代码

栏目: 操作系统 / 发布于: / 人气:3.13W

代码如下:

使用python实现Linux异步epoll的代码

import socket

import select

if __name__=="__main__":

s=et(_INET,_STREAM)

ockopt(_SOCKET,_REUSEADDR,1)

(("",20123))

en(10)

epoll=l()

print no()

print LIN|LET

ster(no(),LIN|LET)

while 1:

epoll_list=()

for fd,events in epoll_list:

print fd

print events

if fd==no():

conn,addr=pt()

print 123