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两者均可,但是建议设置未非阻塞
网友评论