Hi all,
I have a load balancing app (isn't to a WebSite or WebFarm). In this
application, all computer can be a client from, or a server to, another
computer in the network.
This app has a sort of different objects to manage. Each object provides a
service to clients.
These objects are published based on a pre-determinated scenario (for
example, three objects in one computer, two in another...) and can be
migrated by the app to another computer, depending on the status of the
computers. These status is constantly updated in a shared database, which is
used to determine the objects to migrate where they're located.
Another application is a client to the published objects. Based on the info
in the database, this app connects to the objects in the right place, and
consumes its services.
Well, my problem is: when all the objects are in an unique computer, local
or not, the client connects to the objects published, but when there are
objects in more than one computer, I got the following exception:
"Object </ObjectName> has been
disconnected or does not exist at the server."
I verified the path, and it's correct. The problem isn't the Lifetime Lease,
too.
I have no idea about why this exception didn't occurs when all objects are
in an unique computer, even when its computer is other than the computer
where the client app is running. The objects are not related each other.
Am I forgetting something?
//This is a sample of the code
in the executable wich the objects are published based on the scenario
private static TcpChannel
channel = new TcpChannel(8024);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Log), "Log",
WellKnownObjectMode.Singleton);
****************************************************************************
*********
//This is a sample of the code
in the client app ('ip' comes from the database)
log = (Log)
Activator.GetObject(typeof(Log), "tcp://" + ip + ":8024/Log");
I'm not sure if I could explain my problem clearly. If not, please, let me
know.
Thanks in advance,
Fabr?cio de Novaes Kucinskis.
Raghu Rudra - 21 Aug 2003 20:11 GMT
I am not sure if this answers your question or not.
If you are doing any load balancing, you should be using RealProxy. I don't
find any thing wrong with your client code. But the following article shows
how to handle load balancing:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/h
awkremoting.asp
If you are still getting the error, may be simply retry operation will
suffice. For example, when get an exception, simply retry the code that
calls Activator.GetObject again. It worked for us before.
> Hi all,
>
[quoted text clipped - 40 lines]
> RemotingConfiguration.RegisterWellKnownServiceType(typeof(Log), "Log",
> WellKnownObjectMode.Singleton);
****************************************************************************
> *********
>
[quoted text clipped - 8 lines]
>
> Fabr?cio de Novaes Kucinskis.