<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: System.Net.WebException when issuing more than two concurrent WebRequest&#8217;s</title>
	<atom:link href="http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/</link>
	<description>From the whiteboard to the keyboard</description>
	<lastBuildDate>Sat, 04 Feb 2012 13:53:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Kenny Clement</title>
		<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/#comment-91</link>
		<dc:creator>Kenny Clement</dc:creator>
		<pubDate>Tue, 15 Apr 2008 13:34:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.architectingwith.net/2007/08/16/SystemNetWebExceptionWhenIssuingMoreThanTwoConcurrentWebRequests.aspx#comment-91</guid>
		<description>Your connection is never closed because you forgot to close the reponse stream. And you can only have 2 concurrent connections by default, so the others will time out.

So:
replace

request.GetResponse();

by

request.GetResponse().Close();

And it will work! (I&#039;ve been searching on the same problem for quite a while now)
Upping the connection limit because of this is a bad idea (and against the RFC guidelines: max 2 concurrent connections)</description>
		<content:encoded><![CDATA[<p>Your connection is never closed because you forgot to close the reponse stream. And you can only have 2 concurrent connections by default, so the others will time out.</p>
<p>So:<br />
replace</p>
<p>request.GetResponse();</p>
<p>by</p>
<p>request.GetResponse().Close();</p>
<p>And it will work! (I&#8217;ve been searching on the same problem for quite a while now)<br />
Upping the connection limit because of this is a bad idea (and against the RFC guidelines: max 2 concurrent connections)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Kirkland</title>
		<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/#comment-90</link>
		<dc:creator>Scott Kirkland</dc:creator>
		<pubDate>Wed, 12 Sep 2007 18:16:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.architectingwith.net/2007/08/16/SystemNetWebExceptionWhenIssuingMoreThanTwoConcurrentWebRequests.aspx#comment-90</guid>
		<description>Thanks for your article, it was really helpful because I was having a similar problem with my web-based application.  In order to fix the problem, I had to add the following lines to my configuration file:

&lt;connectionManagement&gt;
      &lt;clear/&gt;
      &lt;add address=&quot;*&quot; maxconnection=&quot;100&quot; /&gt;
&lt;/connectionManagement&gt;

-- It appears the clear tag is necessary, since before adding that line I was still only able to maintain two connections.  My guess is that some default ASP.NET configuration sets maxconnection=&quot;2&quot; so you have to remove that first.

Thanks again, and I hope this is helpful to your readers if they are working with web projects.</description>
		<content:encoded><![CDATA[<p>Thanks for your article, it was really helpful because I was having a similar problem with my web-based application.  In order to fix the problem, I had to add the following lines to my configuration file:</p>
<p>&lt;connectionManagement&gt;<br />
      &lt;clear/&gt;<br />
      &lt;add address=&quot;*&quot; maxconnection=&quot;100&quot; /&gt;<br />
&lt;/connectionManagement&gt;</p>
<p>&#8211; It appears the clear tag is necessary, since before adding that line I was still only able to maintain two connections.  My guess is that some default ASP.NET configuration sets maxconnection=&quot;2&quot; so you have to remove that first.</p>
<p>Thanks again, and I hope this is helpful to your readers if they are working with web projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wade Wegner</title>
		<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/#comment-89</link>
		<dc:creator>Wade Wegner</dc:creator>
		<pubDate>Sun, 19 Aug 2007 18:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.architectingwith.net/2007/08/16/SystemNetWebExceptionWhenIssuingMoreThanTwoConcurrentWebRequests.aspx#comment-89</guid>
		<description>Hi Steven,

While your suggestion may in fact work, I wonder if it&#039;s the best way to go about resolving the two concurrent connection limitation.

Off the top of my head I can&#039;t think of any good reasons why it would be wrong to Abort the request except that it seems a bit of a &quot;hack.&quot;  I have typically seen the Abort method used when you need to abort an asynchronous web request if a specified period of time has expired (e.g. the resouce is unavailable), not to Abort an otherwise successful request/response.

The HttpWebRequest does not implement IDisposable, so I don&#039;t believe there&#039;s any reason to explicitly try to close, abort, or otherwise dispose of the object (unlike HttpWebResponse, which does implement IDisposable).

Any reason you&#039;d rather Abort the method instead of change the underlying configuration to allow more than two concurrent connections?

Thank you for sharing your idea!</description>
		<content:encoded><![CDATA[<p>Hi Steven,</p>
<p>While your suggestion may in fact work, I wonder if it&#8217;s the best way to go about resolving the two concurrent connection limitation.</p>
<p>Off the top of my head I can&#8217;t think of any good reasons why it would be wrong to Abort the request except that it seems a bit of a &quot;hack.&quot;  I have typically seen the Abort method used when you need to abort an asynchronous web request if a specified period of time has expired (e.g. the resouce is unavailable), not to Abort an otherwise successful request/response.</p>
<p>The HttpWebRequest does not implement IDisposable, so I don&#8217;t believe there&#8217;s any reason to explicitly try to close, abort, or otherwise dispose of the object (unlike HttpWebResponse, which does implement IDisposable).</p>
<p>Any reason you&#8217;d rather Abort the method instead of change the underlying configuration to allow more than two concurrent connections?</p>
<p>Thank you for sharing your idea!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Gill</title>
		<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/#comment-88</link>
		<dc:creator>Steven Gill</dc:creator>
		<pubDate>Sun, 19 Aug 2007 18:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.architectingwith.net/2007/08/16/SystemNetWebExceptionWhenIssuingMoreThanTwoConcurrentWebRequests.aspx#comment-88</guid>
		<description>I have just been using GetWebRequest for the first time and experienced exactly the same thing!

The reason I&#039;m in this mess is that all the example code (even on MSDN) doesn&#039;t close the connection and so reaches this 2 connection limit.

I just added a Request.Abort(); after dealing with the response and all seems well for an unlimited number of times now!</description>
		<content:encoded><![CDATA[<p>I have just been using GetWebRequest for the first time and experienced exactly the same thing!</p>
<p>The reason I&#8217;m in this mess is that all the example code (even on MSDN) doesn&#8217;t close the connection and so reaches this 2 connection limit.</p>
<p>I just added a Request.Abort(); after dealing with the response and all seems well for an unlimited number of times now!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wade Wegner</title>
		<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/#comment-87</link>
		<dc:creator>Wade Wegner</dc:creator>
		<pubDate>Fri, 17 Aug 2007 15:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.architectingwith.net/2007/08/16/SystemNetWebExceptionWhenIssuingMoreThanTwoConcurrentWebRequests.aspx#comment-87</guid>
		<description>Thanks, Saravana!  I appreciate the feedback!</description>
		<content:encoded><![CDATA[<p>Thanks, Saravana!  I appreciate the feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saravana ramkumar</title>
		<link>http://www.wadewegner.com/2007/08/systemnetwebexception-when-issuing-more-than-two-concurrent-webrequests/#comment-86</link>
		<dc:creator>Saravana ramkumar</dc:creator>
		<pubDate>Fri, 17 Aug 2007 15:26:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.architectingwith.net/2007/08/16/SystemNetWebExceptionWhenIssuingMoreThanTwoConcurrentWebRequests.aspx#comment-86</guid>
		<description>Excellent Article.Its really good article especially when you are dealing with multiple webservices in biztalk server
Thanks
Saravana</description>
		<content:encoded><![CDATA[<p>Excellent Article.Its really good article especially when you are dealing with multiple webservices in biztalk server<br />
Thanks<br />
Saravana</p>
]]></content:encoded>
	</item>
</channel>
</rss>

