Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Socket server connection test

53 views
Skip to first unread message

Küržat

unread,
Mar 18, 2008, 11:56:06 AM3/18/08
to
Hi,

I have started to test my socket server. In my first test case, the server
only accepts client connections and pushes accepted sockets to a queue.No
send or recv posted. I wrote a small client application which connects to
the server in a loop. After ~3000 connections established, client
application catchs an exception saying "An operation on a socket could not
be performed because the system lacked sufficient buffer space or because a
queue was full". At that point non-paged memory usage of the server is about
1600K. I tried to run test application on a different machine, nothing
changed. The machine on which the server run has 2GB of RAM. This should not
be a resource(particularly RAM) problem. Then what is the problem?

Thanks in advance.


Volodymyr M. Shcherbyna

unread,
Mar 18, 2008, 12:02:23 PM3/18/08
to
Each object occupies some memory, so probably, your test application has
reached it's quota, and winsock is unable to allocated more memory for
holding object.

--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Küržat" <x...@yy.com> wrote in message
news:edGlMCRi...@TK2MSFTNGP02.phx.gbl...

Küržat

unread,
Mar 18, 2008, 4:01:00 PM3/18/08
to
May be but how can I overcome that limit? My test machine is not trivial. It
have a Core2 Duo 2GHz CPU with 2GB memory installed. I think it should
handle far more connections without any resource issue.


"Volodymyr M. Shcherbyna" <v_sch...@online.mvps.org> wrote in message
news:ehoh9FRi...@TK2MSFTNGP02.phx.gbl...

m

unread,
Mar 18, 2008, 8:38:37 PM3/18/08
to
What OS?

"Kürţat" <x...@yy.com> wrote in message
news:%23c37ELT...@TK2MSFTNGP04.phx.gbl...


> May be but how can I overcome that limit? My test machine is not trivial.
> It have a Core2 Duo 2GHz CPU with 2GB memory installed. I think it should
> handle far more connections without any resource issue.
>
>
> "Volodymyr M. Shcherbyna" <v_sch...@online.mvps.org> wrote in message
> news:ehoh9FRi...@TK2MSFTNGP02.phx.gbl...
>> Each object occupies some memory, so probably, your test application has
>> reached it's quota, and winsock is unable to allocated more memory for
>> holding object.
>>
>> --
>> V.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.

>> "Kürţat" <x...@yy.com> wrote in message

K�r�at

unread,
Mar 19, 2008, 3:02:27 AM3/19/08
to
Windows XP Professional, SP2.

I have found a workaround at http://support.microsoft.com/kb/q196271/ but my
client application still fails with WSAENOBUF after exactly 9988 th.
connection everytime. What magic does number 9988 have?


"m" <m@b.c> wrote in message news:ehyMTmVi...@TK2MSFTNGP03.phx.gbl...
> What OS?
>
> "K�r�at" <x...@yy.com> wrote in message

> news:%23c37ELT...@TK2MSFTNGP04.phx.gbl...
>> May be but how can I overcome that limit? My test machine is not trivial.
>> It have a Core2 Duo 2GHz CPU with 2GB memory installed. I think it should
>> handle far more connections without any resource issue.
>>
>>
>> "Volodymyr M. Shcherbyna" <v_sch...@online.mvps.org> wrote in message
>> news:ehoh9FRi...@TK2MSFTNGP02.phx.gbl...
>>> Each object occupies some memory, so probably, your test application has
>>> reached it's quota, and winsock is unable to allocated more memory for
>>> holding object.
>>>
>>> --
>>> V.
>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.

>>> "K�r�at" <x...@yy.com> wrote in message

Marc

unread,
Mar 21, 2008, 9:49:14 AM3/21/08
to
On Mar 19, 3:02 am, "K�r�at" <x...@yy.com> wrote:
> Windows XP Professional, SP2.
>
> I have found a workaround athttp://support.microsoft.com/kb/q196271/but my

> client application still fails with WSAENOBUF after exactly 9988 th.
> connection everytime. What magic does number 9988 have?
>

It may be you're maxing out on USER or GDI objects. These can be
viewed in Task Manager.

Len Holgate

unread,
Mar 22, 2008, 4:26:36 AM3/22/08
to
The limit is likely due to the default limit for outbound connections
(MaxUserPort). See
http://www.windowsnetworking.com/kbase/WindowsTips/WindowsNT/RegistryTips/Network/RegistryTipTCPMaxUserPort.html
for how to change that; I set it to 65534. The default value is
causing the client to run out of ports and therefore fail. If this is
the problem and you ran the client on multiple machines I expect that
they would all be able to establish that many connections...

Len
www.lenholgate.com

0 new messages