Four macros are defined in the header file Winsock2.h for manipulating and checking the descriptor sets. The variable FD_SETSIZE determines the maximum number of descriptors in a set. (The default value of FD_SETSIZE is 64, which can be modified by defining FD_SETSIZE to another value before including Winsock2.h.) 在引入Winsock2.h前,重定义 FD_SETSIZEhttp://topic.csdn.net/u/20110308/22/48e00c87-5716-4be8-9b6a-3563be5b2d70.html
使用select本来就是为了避免一个客户开一个线程的
用select的话,一个线程可以处理64个客户的连接,如果超过64了,需要用新的线程来处理
#include <winsock2.h>一定要在 #include <winsock2.h>
之上定义,因为 winsock2.h 有 #ifndef FD_SETSIZE
#define FD_SETSIZE 64
#endif /* FD_SETSIZE */
在引入Winsock2.h前,重定义 FD_SETSIZEhttp://topic.csdn.net/u/20110308/22/48e00c87-5716-4be8-9b6a-3563be5b2d70.html