op_select()
注意: 需要 Shared Code 功能
摘要
等待一个或多个 socket 达到指定条件。
语法
op_select (nfds, sockets, timeout)
| 参数 | 类型 | 说明 |
|---|---|---|
nfds |
int |
要检查的 socket 数量 |
sockets |
int * |
socket ID 数组 |
timeout |
struct timeval * |
超时时长 |
返回类型
int
返回 0。
头文件
shared_code_support.h
详细说明
该函数会阻塞,直到收到数据包或超时结束。