使用python實現Linux異步epoll的代碼

來源:文萃谷 3.18W

代碼如下:

使用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

熱門標籤