WCF Calls Blocking so Timeout occurs

O

Olie

I have a WCF service that operates over named pipes which contains
functions to call the server as well as get callbacks from the server.
The client opens just one channel to the server but constantly makes
calls to the server and also receives callbacks from the server.

What I am finding is that occasionally if the calls to the server
coincide with the callbacks then the whole thing can lock up. The
channel then blocks until a Timeout ocurrs and any calls from threads
will block.

When looking deeper I found that whilst in the blocked state any calls
to the server will execute but not return on the client side. It is as
if the thread in the channel that executes both the response and the
callbacks is blocking in some way.

I have spent some time ensuring that both the client and serve
behaviors are correct.

[CallbackBehaviorAttribute(ConcurrencyMode = ConcurrencyMode.Multiple,
UseSynchronizationContext=false)]

[ServiceBehavior(InstanceContextMode = InstanceContextMode::Single,
ConcurrencyMode = ConcurrencyMode::Multiple,
UseSynchronizationContext=false)]

I have also checked that I am not exceeding the throttling and have
tried setting the throttling threads to 200.

I also make sure that all the callback function does is invoke another
thread to do the work so it is not possible that my callback function
is blocking.

I have managed to resolve this problem by separating the calls into
the server and the callbacks into seperate contracts so they operate
over separate channels. This does resolve the problem but I can find
nothing in the documentation that explains why I get this problem. As
far as I can make out I am doing nothing that is outside the
specification of WCF.

Any suggestions as to why this might be happening would be
appreciated.
 

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

Ask a Question

Top