简体   繁体   中英

Detecting connection issues with WCF Reliable messaging

We are using WCF/HTTP based application to send messages from a client to a server and need a quick way of detecting that the server has gone down handling messages. Ideally we need to detect that the server has gone down before sending the message. I am investigating using Reliable messaging as this looks to send a " Are you still there message?" just before each request. However, what I can't find is any way of detecting if this initial check fails in my code - is this possible?

I found a couple of articles which suggested performing some form of 'PING' to detect if the server is still there but if possible I would rather use Reliable Messaging as this seems a cleaner solution.

Any advice would be much appreciated.

"Are you still there message?" will not help you.

Why ?Think of a situation where you have written code like

if(service is up)
{
 //do operation
}

When your control hit the line of operation,what if at that particular point of time service goes down.So there is no point in checking if the service is up or down,instead do something if the service goes down.

   try
{
   //do operation
}
catch(Exception ex)
{
//what to do when service is down.
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM