Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WCF: Configure call handling synchronization at method level?

Status
Not open for further replies.

huckfinn19

Programmer
May 16, 2003
90
CA
Hi, I am using WCF in a client-server architechture, my server has a UI and is configured as follows:

[ServiceBehavior(UseSynchronizationContext = true, InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]

Meaning that all calls done from my clients are marshalled to the UI thread to be handled by the server. This makes sense in the context of my application, but I have one call (two-way) in particular that is quite lenghty and that is thread safe (reentrant). I would therefore like my server to handle that specific method asynchronously, but to keep all other client call handling sychronous.

Here are my questions:

1) Is it possible to configure my server to globally use the UI thread to synchronize the calls (UseSynchronizationContext = true), but to override that property on a per-call basis to specify a few methods that should be handled asynchronously?

2) If it is possible to configure the synchronization mode at the method level, can it be done in the config file of my server?

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top