How to configure maximum number of channels in WCF?

Posted by Hemant on Stack Overflow See other posts from Stack Overflow or by Hemant
Published on 2010-03-17T10:08:53Z Indexed on 2010/03/17 10:11 UTC
Read the original article Hit count: 555

Filed under:
|
|
|

Consider following code which calls a calculator service:

static void Main (string[] args) {
    for (int i = 0; i < 32; i++) {
        ThreadPool.QueueUserWorkItem (o => {
            var client = new CalcServiceClient ();
            client.Open ();
            while (true) {
                var sum = client.Add (2, 3);
            }
        });
    } 

    Console.ReadLine ();
}

If I use TCP binding then maximum 32 connections are opened but if I use HTTP binding, only 2 TCP connections are opened.

How can I configure the maximum number of connections that can be opened using HTTP binding?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about c#