poll函數
来源:互联网 发布:联通网络电视破解软件 编辑:程序博客网 时间:2024/06/16 13:35
原型:int poll(struct pollfd fdarray[], nfds_t nfds, int timeout)
其中poll函数中,结构pollfd如下:
struct pollfd{
int fd; //file descriptor
short event;//event of interest on fd
short revent;//event that occurred on fd
}
要測試的條件由event指定,返回結果在revent存儲。
常用條件的含義:
POLLIN:普通或优先级带数据可读
POLLRDNORM:普通数据可读
POLLRDBAND:优先级带数据可读
POLLPRI:高优先级数据可读
POLLOUT:普通数据可写
POLLWRBAND:优先级带数据可写
POLLERR:发生错误
POLLHUP:发生挂起
POLLNVAL:描述字不是一个打开的文件
第一個參數fdarray:是一个struct pollfd结构类型的数组,用于存放需要检测其状态的Socket描述符。
第二個參數nfds:用於標記數組fdarray中結構體元素的總數。
第三個參數timeout:設置阻塞時間,精確到毫秒。
函數返回準備好讀、寫或出錯狀態的socket描述符的個數,若返回-1,函數調用失敗,errno被設置。
- poll函數
- poll()
- poll
- poll
- poll
- poll()
- poll
- poll
- POLL
- poll
- poll
- poll
- poll
- poll
- poll
- poll
- poll
- Poll Test
- 正则表达式的用法
- android 获取IMSI
- 织梦(dedecms)仿站教程第十三讲—特定栏目调用
- 虚拟机ubuntu下安装配置postgreSQL,及Host机作为客户端访问
- java 编程中使用Pattern+Matcher 从一个大字符串中提取特定文字
- poll函數
- 织梦(dedecms)仿站教程第第十四讲—特定栏目图片调用
- wince6.0 PB工程编译选项简介
- 用事物变式( transaction variants )隐藏sap便准程序的field
- sphinx 全文搜索 软件 工具 的安装使用
- [Axure]原型设计软件:Axure RP简单介绍与基础入门学习目录
- Remote Access To MySQL
- Alax技术实现的基本原理——XMLHttpRequest对象的使用
- UVa 10033 - Interpreter