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)
}
}
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)
}
}