Service call queue

I am implementing a Silverlight application that makes heavy use of WCF services, now I have gotten to the point where sometimes there are several long service calls that block other service calls.

These service calls will eventually end. I would like to see if its a queue system that makes calls to a service one after the other, so long calls will hold other calls, but will not time out.

I am using service agents to transfer service calls

public interface IExampleServiceAgent
    void ProcessData(int a, string b, EventHandler<ProcessDataCompletedEventArgs> callback);

Public ExampleServiceAgent1 : IExampleServiceAgent
     ExampleClient _Client = new ExampleClient();

     public void ProcessData(int anInt, string aString, EventHandler<ProcessDataCompletedEventArgs> callback)
           EventHandler<ProcessDataCompletedEventArgs> wrapper = null;
           wrapper = (a,b) =>
               _Client.ProcessDataCompleted -= wrapper;
           _Client.ProcessDataCompleted += wrapper;


Then the above service agent will be called from the code like this:

ServiceAgent.ProcessData(1,"STRING", (a,b) =>
    if (b.Error != null)
         //Handle Error
         //DO something with the data


Is there a way that I could queue these service calls and execute them one by one?

I tried wrapping them as Actions and adding them to the queue, but that's not waiting for the execution to complete before starting the next one, and although they do call the service correctly, no data is returned to the calling ViewModel.


source to share

1 answer

WCF services can handle a huge number of calls, but to avoid denial of service attacks, the number of requests that can be processed is limited by default.

Significant restrictions for Silverlight WCF services will be

  • The default limit is for two simultaneous calls from the same IP address.
  • The limit is approximately 10-16 concurrent connections (documentation depends on this).

See this CodeProject article on Tips for Improving Performance and Scalability in ASP.NET, WCF, and Desktop Clients .

I assume you get into the first issue right away. In your WCF configuration, you need to add the following to increase single IP connections:

    <add address="*" maxconnection="100" /> 


Then you can push the second limit for which the solution changes the service behavior in the web / app.config files.

Here are some more links I found while parsing these issues myself:



All Articles