views:

523

answers:

1

Hi,

i have a web server with my web site and i try stress it but i 'don't be able. I think that the problem is limitated number of concurrent connection in xp(Pro). I wrote a simple client in C# for stress:

...

for (int i = 0; i < _numThread; i++) {

Thread t = new Thread(CallGetHttp);

t.Start();

}

...

private void CallGetHttp()

{

WebRequest wrGETURL; wrGETURL = WebRequest.Create(_url);

WebProxy myProxy = new WebProxy("myproxy", 80); myProxy.BypassProxyOnLocal = true;

wrGETURL.Proxy = WebProxy.GetDefaultProxy();

Stream objStream; objStream = wrGETURL.GetResponse().GetResponseStream();

StreamReader objReader = new StreamReader(objStream);

.. }

it's proper? If yes, how i increase a number of concurrent connection?

Best Regard

Domenico

+2  A: 

The connection limit is on inbound sockets, and it's hardcoded into XP's network stack to prevent them being used as servers (more money for Microsoft...) Your only choice is to move to Windows Server if your on a microsoft stack, or legally move to linux if your code will suppport it. Look into mono provided that your not doing anything too specific.

Also be careful to fall into the virtual PC trap. Network access from microsoft virtual PC is via the XP network stack. So if you run linux inside a VM inside XP, you're still constrained to the 10 inbound connections.

Spence
Thank you, so i try with Mono.Domenico
Domenico
Don't forget to mark your question answered...
Spence