What's the maximum connects can IOCP accept and hold
I do some IOCP Server and Client test. The IOCP Server accept the clients' connects and do nothing but recv datapackets from clients. The clients connect the server and send datapackets to server i开发者_JAVA百科n an infinit loop.
I set a counter. It increase when the server accepts a client, and decrease when a socket is closed.
Here is the question: The counter increases to 32261 and not increases any more. The Server cannot accept more connects, The GetLastError() return 10055, WSAENOBUF.
My OS is Windows XP, memory is 4GB. And I have check the nonpaged memory. I think my memory is enough.
What limits the maximum of connects? How can I enlarge the maximum connects?
It's difficult to say what's causing your problem without seeing your code. It's unlikely to be non-paged pool exhaustion; I've run tests on Windows Server 2003 with only 760MB ram and achieved more than 70,000 concurrent connections with an IOCP based server (see here). It could be the I/O page lock limit (see here); but that depends on what your server is doing once it has accepted the connections, is it posting reads, if so what buffer size? As far as I know, BOTH non-paged pool exhaustion AND the I/O page lock limit will give WSAENOBUF
errors.
Have you tried your tests on a more modern and/or server class OS? Vista and later make much more non-paged pool available (see here for details)...
The limit for the unpageable memory was hit. Are you using Push Framework to test with IOCP ?
精彩评论