int select( __in int nfds, __inout fd_set *readfds, __inout fd_set *writefds, __inout fd_set *exceptfds, __in const struct timeval *timeout ); Parameters nfds [in] Ignored. The nfds parameter is included only for compatibility with Berkeley sockets. readfds [in, out] An optional pointer to a set of sockets to be checked for readability. writefds [in, out] An optional pointer to a set of sockets to be checked for writability. exceptfds [in, out] An optional pointer to a set of sockets to be checked for errors. timeout [in] The maximum time for select to wait, provided in the form of a TIMEVAL structure. Set the timeout parameter to null for blocking operations. Return Value The select function returns the total number of socket handles that are ready and contained in the fd_set structures, zero if the time limit expired, or SOCKET_ERROR if an error occurred. If the return value is SOCKET_ERROR, WSAGetLastError can be used to retrieve a specific error code. 详情见:http://msdn.microsoft.com/zh-cn/library/ms740141(v=VS.85).aspx