网络

epoll

1、int epoll_create(int sz)

2、int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);

2.1 op

EPOLL_CTL_ADD 

EPOLL_CTL_MOD

EPOLL_CTL_DEL

2.2 event->events

EPOLLIN

EPOLLOUT

EPOLLERR

EPOLLHUP

EPOLLPRI

        EPOLLET

EPOLLONESHOT

还有几个没记住


3、int epoll_wait(int epfd , struct epoll_event *events, int maxevents, int timeout);

4int epoll_pwait

fd最好设置为非阻塞,ET模式下必须设置为非阻塞,

LT两者均可,但是建议设置未非阻塞


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容