Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>All browsers are expected to limit themselves to 2 requests per host, to avoid overloading the host. .NET follows this rule and allows only 2 concurrent connections to a host. You can change this limit either by modifying an application's config file or through code.</p> <ul> <li>To change the limit in the config file, change the maxConnection attribute in the <a href="http://msdn.microsoft.com/en-us/library/fb6y0fyc.aspx" rel="nofollow">system.net/connectionManagement</a> element.</li> <li>To change the limit through code, change the static <a href="http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit.aspx" rel="nofollow">ServicePointManager.DefaultConnectionLimit</a> property.</li> </ul> <p>The Delay you added to the script didn't work because you didn't call Dispose on the WebClient instance. The WebClient class keeps its connection open until you dispose of it in order to read the response stream. Otherwise you will not be able to connect to the same host again until the garbage collector collects the client.</p> <p>Besides, OpenReadAsync opens the stream to the client and ensures it remains open unless you close it or it gets collected. You should use one of the DownloadXXXAsync to avoid opening the stream without a reason.</p> <p>A better solution would be to call DownloadStringAsync and dispose of the client in the DownloadStringAsyncCompleted event. </p> <p><strong>UPDATE:</strong></p> <p>ServicePointManager.DefaultConnectionLimit is stored in a static field which means that its scope is the entire AppDomain. SSIS uses a single AppDomain for each package execution so the value will affect the entire package.</p> <p>If you want to modify the connection limit only for a single host using <a href="http://msdn.microsoft.com/en-us/library/c5f0atwd" rel="nofollow">FindServicePoint</a>, you can create a ServicePoint for the host address and set the limit just for this address:</p> <pre><code>var myTarget= ServicePointManager.FindServicePoint(new Uri("http://www.google.com")); myTarget.ConnectionLimit = 10; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload