Discussion:
Winsock2 accept queue depth
(too old to reply)
Steve Tassio
2004-11-30 16:05:01 UTC
Permalink
For a long time SOMAXCONN = 5. In Winsock2.h its defined as 0x7fffffff. I
have a listening socket in a thread to accept connections to an array of
working sockets that run in their own threads. Using XP SP1, .NET 2003, MFC
C++. I found SOMAXCONN to still be = 5. I dragged Winsock2.h and WS2_32.lib
from the Feb 04 Platform SDK into my project and still find SOMAXCONN = 5. I
tried this -
#define SOMAXCONN 0x7fffffff
but my symptoms don't go away. They are, if I try to spawn over 70 threads
that connect to the accept socket I get many of this error -
WSAECONNREFUSED - 10061
The socket array has 200 available sockets and each thread is probably
active about 120ms only. Ultimately I need to sustain 250 simultaneous
connections. Is there a work around for this? Thank you!
Alun Jones [MSFT]
2004-11-30 17:16:21 UTC
Permalink
Post by Steve Tassio
For a long time SOMAXCONN = 5. In Winsock2.h its defined as 0x7fffffff. I
have a listening socket in a thread to accept connections to an array of
working sockets that run in their own threads. Using XP SP1, .NET 2003, MFC
C++. I found SOMAXCONN to still be = 5. I dragged Winsock2.h and WS2_32.lib
from the Feb 04 Platform SDK into my project and still find SOMAXCONN = 5. I
tried this -
#define SOMAXCONN 0x7fffffff
but my symptoms don't go away. They are, if I try to spawn over 70 threads
that connect to the accept socket I get many of this error -
WSAECONNREFUSED - 10061
The socket array has 200 available sockets and each thread is probably
active about 120ms only. Ultimately I need to sustain 250 simultaneous
connections. Is there a work around for this? Thank you!
Workstation-class operating systems are limited to a backlog of 5,
server-class operating systems (Windows 2003 Server, Windows Server 2000,
Windows NT 4 Server, etc) have different limits on the backlog.

Alun.
~~~~
Arkady Frenkel
2004-11-30 20:02:28 UTC
Permalink
Steve , just be aware that backlog is stack of not yet accepted connections
on server ( between listen() and accept() , but number of accepted (
established ) sockets limited only by memory resources and only in 9x that
limited to 100
Arkady
Post by Alun Jones [MSFT]
Post by Steve Tassio
For a long time SOMAXCONN = 5. In Winsock2.h its defined as 0x7fffffff. I
have a listening socket in a thread to accept connections to an array of
working sockets that run in their own threads. Using XP SP1, .NET 2003, MFC
C++. I found SOMAXCONN to still be = 5. I dragged Winsock2.h and WS2_32.lib
from the Feb 04 Platform SDK into my project and still find SOMAXCONN =
5.
Post by Alun Jones [MSFT]
Post by Steve Tassio
I
tried this -
#define SOMAXCONN 0x7fffffff
but my symptoms don't go away. They are, if I try to spawn over 70 threads
that connect to the accept socket I get many of this error -
WSAECONNREFUSED - 10061
The socket array has 200 available sockets and each thread is probably
active about 120ms only. Ultimately I need to sustain 250 simultaneous
connections. Is there a work around for this? Thank you!
Workstation-class operating systems are limited to a backlog of 5,
server-class operating systems (Windows 2003 Server, Windows Server 2000,
Windows NT 4 Server, etc) have different limits on the backlog.
Alun.
~~~~
Loading...