Lua的epoll模塊:lua-epoll
Lua的epoll模塊
更多細節,請查看sample.lua
API:
ok,err=epoll.setnonblocking(fd)
設置一個文件描述符非阻塞。
epfd,err=epoll.create()
創建一個 epoll 文件描述符。
ok,err=epoll.register(epfd,fd,eventmask)
把目標文件描述符 fd 注冊到由 epfd 引用的 epoll 實例上并把相應的事件 event 與內部的 fd 相鏈接。
ok,err=epoll.modify(epfd,fd,eventmask)
更改目標文件描述符 fd 相關聯的事件 event。
ok,err=epoll.unregister(epfd,fd)
從由 epfd 引用的 epoll 實例中刪除目標文件描述符 fd。
events,err=epoll.wait(epfd,timeout,max_events)
在一個 epoll 文件描述符上等待 I/O 事件。
ok,err=epoll.close(epfd)
關閉一個 epoll 文件描述符。
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!