Nigel Tunnicliffe
Nigel Tunnicliffe

Reputation: 131

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.

Upvotes: 0

Views: 30

Answers (1)

Hameed Syed
Hameed Syed

Reputation: 4275

"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.
}

Upvotes: 0

Related Questions