- 论坛徽章:
- 0
|
本帖最后由 iw1210 于 2013-01-23 16:05 编辑
select函数在有句柄可以读写返回时,不直接返回是哪个句柄么? 看介绍好像不是返回那个句柄啊:
RETURN VALUE
On success, select() and pselect() return the number of file descrip-
tors contained in the three returned descriptor sets (that is, the
total number of bits that are set in readfds, writefds, exceptfds)
which may be zero if the timeout expires before anything interesting
happens. On error, -1 is returned, and errno is set appropriately; the
sets and timeout become undefined, so do not rely on their contents
after an error.
这里说的如果成功返回什么?没翻译明白~
难道必须用FD_ISSET逐个判断集合内的句柄是否可读写?如果集合内有几十万个句柄,岂不是很慢了? |
|