Wednesday, August 08, 2007

Reliable Sessions on WCF

Hi folks,

WCF give a greate feature called Reliable Session,when you enable the reliable sessions on your service and your clients,you give your clients a very great advantage which is the client app can sends messages to the Service without waiting for the service reply.

One will ask ? what's the harm for the client app to wait for Service reply ? if the service is busy,and client will wait and blocked until getting the response fro mthe service.and if you put a timeout for your bindings,then excpetion will be thrown against your client.

another point,in cases like client wants to invoke the serivce and doesnt want to wait,you will use the OneWay operation attribute on your service but this will lead to the blocking of your client until getting the response.to avoid this just enable the reliable sessions property on your bindings on the service and the client.

Note : mark your serivce as ConcurrencyMode.Multiple attribute will not avoid the client blocking,but it will change the way of the serivce how it deals with the incoming messages since the default mode for all services is single threaded.


Hope this tips helps........... :)



Regards,
Moustafa arafa

No comments: