Okay, sorry to bump this thread, but just in case people run into the same problem I do with this, Overlapped I/O has *absolutely nothing* to do with what was going wrong.
See winsock.h:
And there you go. I had this problem years ago with my servers like this and I simply forgot this one, simple, stupid rule--FD_SETSIZE limits the amount of file descriptors you can use on any server. This has nothing to do with the I/O, it's simply because the number of file descriptors was capped to 64 by default by winsock.h. All you have to do is #define FD_SETSIZE to a multiple of 1024 and you're all set. I can't believe I missed this.Code:typedef UINT_PTR SOCKET; /* * Select uses arrays of SOCKETs. These macros manipulate such * arrays. FD_SETSIZE may be defined by the user before including * this file, but the default here should be >= 64. * * CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE * INCLUDED IN WINSOCK.H EXACTLY AS SHOWN HERE. */ #ifndef FD_SETSIZE #define FD_SETSIZE 64 #endif /* FD_SETSIZE */ typedef struct fd_set { u_int fd_count; /* how many are SET? */ SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */ } fd_set;