C# webservice consumer app hitting MaxConnect=2 limit

I

intrepid_dw

Hi, all

In debugging a C#-based .NET app that talks to a remote web service, I
was observing a particular behavior in which this app would generate
what I'd call a "burst" of calls to a web service. After these calls
fired, the application would block on any subsequent calls to the web
service.

After rummaging around, I finally came across the fact that the app was
hitting the wall imposed by the "maxConnects" parameter of
machine.config, and trying to open more than two simultaneous
connections to the same web endpoint. Changing this number for the sake
of test (in machine.config) (from 2 to 5) immediately resolved the
problem for the application, but I'm not sure I can make the assumption
I will be able to change that figure on machines using the app.

Are there programmatic workarounds to this, or settings in an
app-specific config file I can use that will overcome this limit? The
"burst" of calls is unusual, but correct within the context of the
application, so at the moment I'm awfully reluctant to try redesigning
that part of the program merely to overcome a single configuration
setting...

Any suggestions appreciated.

-intrepid
 
V

Vadym Stetsyak

Hello, (e-mail address removed)!
You wrote on 6 Aug 2006 11:47:15 -0700:

id> In debugging a C#-based .NET app that talks to a remote web service, I
id> was observing a particular behavior in which this app would generate
id> what I'd call a "burst" of calls to a web service. After these calls
id> fired, the application would block on any subsequent calls to the web
id> service.

id> After rummaging around, I finally came across the fact that the app was
id> hitting the wall imposed by the "maxConnects" parameter of
id> machine.config, and trying to open more than two simultaneous
id> connections to the same web endpoint. Changing this number for the sake
id> of test (in machine.config) (from 2 to 5) immediately resolved the
id> problem for the application, but I'm not sure I can make the assumption
id> I will be able to change that figure on machines using the app.

id> Are there programmatic workarounds to this, or settings in an
id> app-specific config file I can use that will overcome this limit? The
id> "burst" of calls is unusual, but correct within the context of the
id> application, so at the moment I'm awfully reluctant to try redesigning
id> that part of the program merely to overcome a single configuration
id> setting...

id> Any suggestions appreciated.

Try to increase
ServicePointManager.DefaultConnectionLimit

Additionally take a look at the thread
(
http://groups.google.com.ua/group/m...603e4?lnk=st&q=&rnum=1&hl=uk#65c4e4605cf603e4 )
The same problem was discussed there...
 
I

intrepid_dw

Vadym

Thank you so much for your quick assistance and solution.

The resolution you suggested worked perfectly. My problem is solved!!

-intrepid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top