Currently i am facing a problem i do not understand. I have an wcf client that calls a wcf service through several threads at the same time (both on the same machine). Somet
HTTP protocol defines a limit of 2 connections to the same web server at the same...
Since you are using http the behaviour you see might be related to that limit...
There is a registry setting for this and a programatic way - you probably need to increase that limit on your client (depending on the quantity of threads you are using)...
Other relevant settings (client-side) can be found here.
I had the same problem. In my case it was my mistake. I closed the channelFactory (proxy) after starting threads.
I'd suggest to verify 2 points:
Throttling on the server, like
behavior name="Throttled"
serviceThrottling
maxConcurrentCalls="1"
maxConcurrentSessions="1"
maxConcurrentInstances="1"
Not closed WCF sessions - do you close all your sessions (client proxy) after used?
In my case when I enlarged all timeouts to max, I got situation when after X calls, service became "stuck". When I changed timeouts, I was received exception like yours.
It was several years ago, So i did not remember exactly. Also, I remember I found good article that was described how and why to change Service Instance mode to help this (sessions) issue.
Ok, this is what happening - you have a faulty network card that is being overheated after few hours and when that happens it begins to short-circuit, as result your client side "thinks" that the server was shut down. End of story - 100% sure. where's my bounty?
btw: it is overheated either cause of bad design especially if you are using laptop or due to a damage already exists in it.
Try to enable tracing at WCF side, you would get detailed information as to what is happening at server side.
Also sometimes WCF channel factory is closed abruptly when client sending big number of requests. we faced similar issue when we have used certificate authentication with WCF. In that we have deviced RetryPolicy around this transient error. if we get this error, we abort channel factory, recreate and send again rather than throwing exception.
while (retryCount <= MAXRETRY)
{
try
{
return _proxyService.GetData(); // _proxyService is WCF proxy class
}
catch (CommunicationException transientException)
{
if (SLEEPINTERVAL> 0)
{
Thread.Sleep(SLEEPINTERVAL);
}
((IClientChannel) _proxyService).Abort();
_proxyService = functionToCreateProxy();
}
retryCount++;
}