select 详解
Posted mingzhang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了select 详解相关的知识,希望对你有一定的参考价值。
In summary, a socket will be identified in a particular set when select returns if:
readfds:
If listen has been called and a connection is pending, accept will succeed.
Data is available for reading (includes OOB data if SO_OOBINLINE is enabled).
Connection has been closed/reset/terminated.
writefds:
If processing a connect call (nonblocking), connection has succeeded.
Data can be sent.
exceptfds:
If processing a connect call (nonblocking), connection attempt failed.
OOB data is available for reading (only if SO_OOBINLINE is disabled).
以上是关于select 详解的主要内容,如果未能解决你的问题,请参考以下文章