Using Remoting how to tell server is down verses error doing servi

P

Philip K

I am using .NET Framework v2.0 and using a singleton object.

I am using some thing like:

//
// Connect/reconnect by creating object at server and getting proxy
//
if(!commsOK)
{
if(timeToRetryComms)
{
MyRemotingObject myRemotingObject = new MyRemotingObject();
myRemotingObject =
(IMyRemotingObject) Activator.GetObject(
typeof(IMyRemotingObject), url);
commsOK = (myRemotingObject != null);
}
}

//
// If the object is still communicating use it - mark comms down if com fails
//
if(commsOK)
{
try
{
myRemotingObject.DoOperation(a,b,c);
}
catch(WebException)
{
commsOk = false;
}
catch(RemotingTimeoutException)
{
commsOk = false;
}
catch(Exception ex) // comms still assumed to be OK
{
TellUserWhatTheErrorIsSoHeCanFixIt(ex); // i.e. File I/O error at
server
// errors like (user gave wrong directory path or such)
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top