select、poll和epoll简介
说明:本篇文章是网上各种资料杂烩而成。如有雷同,纯属自然。
select
select功能介绍
select系统调用的功能是对多个文件描述符进行监视,当有文件描述符的文件读写操作完成,发生异常或者超时,该调用会返回这些文件描述符。
int select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,struct timeval *timeout);
select关键结构体
这里先介绍一些关键的结构体:
typedef struct {
unsigned long *in, *out, *ex;
unsigned long *res_in, *res_out,...