Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:56:21+00:00 2026-06-05T06:56:21+00:00

I have a quite strange situation. I have this very simple package: Task get

  • 0

I have a quite strange situation.

I have this very simple package:

enter image description here

  • Task “get list” retrieves a data table from an assembly with one
    column and a list of URL to be ran into a object variable.
  • The “foreach” loop loops through the object variable and loads the
    URL into a url string variable
  • The “run”, calls the url with this code (its 2005 so Im stuck with
    VB):

    Dim myURI As New Uri("http://" + Dts.Variables("URL").Value.ToString())
    Dim myWebClient As New System.Net.WebClient
    myWebClient.OpenReadAsync(myURI)
    

the URL being called is internal and just reads the parameters and performs a series of operation which take some time, that’s why I used “OpenReadAsync”

My problem is: if I have 4 URLs to run, the package runs only 2 of them. The loop lops 4 times, the script is called 4 times (I can see if I debug it), the line myWebClient.OpenReadAsync(myURI) is executed 4 times with 4 different values, but only 2 calls to the URL are made.

If I run the package again, the other 2 URLs are now called, which proofs that there isn’t anything wrong with the URL and If I call the 4 urls manually on the browser (on 4 tabs for example) one right after another, them all produce the expected result, which proofs that there is nothing wrong with the code that parses the URL.

So I’m left with the VB code, its the first time Im using uri and WebClient so I wonder if Im doing something wrong. I also tried to add a 5 seconds sleep between the calls, but no luck.

Any help would be appreciated.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:56:22+00:00Added an answer on June 5, 2026 at 6:56 am

    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.

    • To change the limit in the config file, change the maxConnection attribute in the system.net/connectionManagement element.
    • To change the limit through code, change the static ServicePointManager.DefaultConnectionLimit property.

    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.

    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.

    A better solution would be to call DownloadStringAsync and dispose of the client in the DownloadStringAsyncCompleted event.

    UPDATE:

    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.

    If you want to modify the connection limit only for a single host using FindServicePoint, you can create a ServicePoint for the host address and set the limit just for this address:

    var myTarget= ServicePointManager.FindServicePoint(new Uri("http://www.google.com"));
    myTarget.ConnectionLimit = 10;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a quite strange problem. I have set a setting variable in Application
I have quite a strange problem , While copying one WidgetCollection from one FlowPanel
I didn't really know how to phrase this question, its quite strange. I have
I have a quite simple data capture web app. In the main capture window,
I have quite a strange problem with PHP and Apache on my local testing
I have just come across something that is quite strange and yet I haven't
I have a strange problem that I can't seem to solve. I've quite a
I have quite big document in html format that generated from Microsoft Word. It
I have quite a few situations where I have database structures similar to: TABLE
I have quite a lot of C++ legacy code modules from my colleagues, unfortunately

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.