remoting

  • Thread starter Thread starter frazer
  • Start date Start date
F

frazer

i am checking a remoting sample and cant understand what this means.
what does this mean?


if(!System.Runtime.Remoting.RemotingServices.IsTransparentProxy(Object1))
{
throw new ApplicationException("Configure remoting first");
}
 
Good question. I am not a remoting guru but I will do my best. What actually
happens in the example is checking the type of the proxy provided by the
system for the remotable object. The proxy pretends to look as the real
object to the caller, but it does all the routine work like marshalling and
communicating over the remoting channel behind the scenes.

To quote the MSDN:

----------------------------------------------------------------------------
------
A client that uses an object across any kind of a remoting boundary is
actually using a transparent proxy for the object. The transparent proxy
gives the impression that the actual object resides in the client's space.
It achieves this by forwarding calls made on it to the real object using the
remoting infrastructure.
The transparent proxy is itself housed by an instance of a managed runtime
class of type RealProxy. The RealProxy implements a part of the
functionality needed to forward the operations from the transparent proxy. A
proxy object inherits the associated semantics of managed objects such as
garbage collection, support for fields and methods, and can be extended to
form new classes. Thus the proxy has a dual nature; on the one hand it needs
to act as an object of the same class as the remote object (transparent
proxy), and on the other it is a managed object itself.
 
Actually not entirely true.
The reason you want to check this is because you may have configured the
proxy alright, but when you instantiate teh remote object you may have a
reference to the "real" object itself. To ensure this is not the case
you need to make the check.
This could happen if you have shared implementation of your
remoting objects typically.
 

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

Back
Top