views:

22

answers:

1

Imagine a duplex WCF service that contains a list of subscribers. At some point the service sends data to all subscribers, and some of them may immediately call into the service again. The ConcurrencyMode of the service is Single, so this call fails with an exception.

I would like to avoid that exception and found two possible solutions:

  1. Change the ConcurrencyMode to Reentrant or even Multiple. This requires internal syncing so I'd prefer to avoid it.
  2. Make sure the client waits for the call from the server to finish before calling again. This requires some buffering on the client side, but I'll probably still chose it.

What do you think of these ideas? Are there any other ways? How did you solve it?

A: 

I would suggest you read chapter 8.2 of Programming WCF Services by Juval Lowy. It deals with the issue of reentrancy as well as how to design for reentrancy, as there can be some gotchas.

MetalLemon
Added to wishlist :) Could you quickly summarize the ideas given?
mafutrct