int nRet = ::select(0, &fdRead, NULL, NULL, NULL);
这个函数执行完以后nret 跟 fdRead.fd_count 有什么区别?????

解决方案 »

  1.   

    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.如果fdRead中的所有socket都ready的话,那么nret 就 等于 fdRead.fd_count 
      

  2.   

    如果select不出错的话值应该是一样的吧
      

  3.   


    If the socket is currently in the listen state, it will be ed as readable if an incoming connection request has been received such that an accept is guaranteed to complete 判断那个监听套接字是否可读就行了。利用你上面的那个select,FD_ISSET判断套接字是否在fdRead集合中就行了。
      

  4.   

    Windows Socket五种I/O模型——代码全攻略(一)(转)
    http://hi.baidu.com/xyh2007/blog/item/7f2ebf3de1e69e07bba1674e.html