网路编程--poll

来源:互联网 发布:单片机课设 编辑:程序博客网 时间:2024/06/14 01:04

参考:http://www.cnblogs.com/alyssaCui/archive/2013/04/01/2993886.html

struct pollfd 结构

struct pollfd {
int fd;        /* 文件描述符 */
short events; /* 期待发生的事件 */
short revents; /* 实际发生了的事件 */
};

#include <poll.h>
int poll(struct pollfd fds[], nfds_t nfds, int timeout);

struct pollfd fds[] 用于存放需要检测其状态的socket描述符

0 0