Limit the number of asyn web service calls

Discussion in 'ASP .Net Web Services' started by Paul Welter, Nov 4, 2003.

  1. Paul Welter

    Paul Welter Guest

    I have a web service the makes calls asynchronously to a server to download
    files. The user has the ability to select many files to download. When
    making the web service call using the proxy class, the async call goes on
    the thread pool. The problem is that the thread pool can have 25 threads.
    So, the user could potentially be downloading 25 files at a time. This will
    overwhelm the clients internet connection. I'd like to find an easy way to
    limit the number of async calls while queuing the rest without blocking the
    UI thread. How do I change the number of threads the thread pool can have?
    Do I have to implement my own thread pool? If so, how would I do that and
    how would I tell the proxy class to use my thread pool?

    Paul Welter, Nov 4, 2003
    1. Advertisements

  2. Paul Welter

    MSFT Guest

    Hi Paul,

    The ThreadPool class in .NET only support to set minthread number, not with
    maxthreads number. I think you may consider create a queue object in your
    application, when user want to download files, you may add the file list to
    the queue component and let this component to control the number of files
    which will be download at same time. Will this help on the situation?

    Microsoft Online Support

    Get Secure!
    (This posting is provided "AS IS", with no warranties, and confers no
    MSFT, Nov 5, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.