I try to make a multiple-thread requester in order to test answer time of my server.
My server is a WCF webservice, and my client has a service reference to this webservice.
WCF respect HTTP specifications, and I see on many websites WCF is Keep-Alive enabled by default. By only two connections from the same client are authorized at same time.
So, when I try to create 100 threads, only two of them are processing at the same time. So, after few loops, a lot of threads are in timeout.
I try to follow this article : WCF wsHttpBinding with http keepalive but it didn't work.
Here is my app config (modified by the Service Reference) :
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISabIn" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://xxx.xxx.xxx.xxx:xxx/SabIn.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ISabIn" contract="TestWs.ISabIn"
name="BasicHttpBinding_ISabIn" />
</client>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
I try to use customBinding in the appCode, like this article : HTTP Keep-alive and ServiceHost / C#? but, when I execute my software, an erreor appears about "application/xml". If I try to translate in english, it would be somehting like "your client don't manage the application/xml message".
I need to do real-time transactions, and I can't if WCF only manage two sockets at same time...
Can you help me ?
PS : I can post the code of my client, but I'm not sure is useful since I know the problem is a sockets limitation.
SOLUTION (thnaks to Spender) : at the beginning of your code, change the default value (it is 2) in System.Net.ServicePointManager.DefaultConnectionLimit