Hi...
Ques : Hello friend now I am working in a remoting but I have some confusion please explaine why we have used marshal by ref object in a remoting.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 30, 2012, 10:29 PM
The different forms of marshaling are used to describe how objects behave when they are passed between AppDomain instances via normal function calls. An AppDomain is often known as a light weight process and provides an isolated container for managed objects to run in. Here's a quick breakdown of the different types.
All types which derive from MarshalByRefObject will marshal by reference. These object instances do not travel between AppDomain instances. They are allocated in a specific AppDomain and do not leave it.
When a reference to a MarshalByRefObject is passed across an AppDomain boundary a proxy is created in the target AppDomain. This proxy can be used to manipulate the object in the original AppDomain but the object itself is not directly accessible.
Please Refer.
http://www.bluebytesoftware.com/blog/2006/08/22/DontLockOnMarshalbybleedObjects.aspx
http://blogs.msdn.com/b/cbrumme/archive/2003/04/15/51334.aspx
hope this help.
Satyapriya NayakPosted Jan 30, 2012, 10:13 PM
Marshal-by-reference objects are remotable objects that extend the System.MarshalByRefObject class. When a client instantiates a marshal-by-reference object, the .NET Remoting infrastructure creates a proxy object in the caller's application domain and returns a reference to that proxy to the caller. When the client makes calls on that object through the proxy, the Remoting infrastructure marshals the calls, sends them to the originator's application domain, and invokes the call on the actual object. Function return values and out parameters are handled similarly on the way back.
You should use marshal-by-reference objects when the state of the object and any executable functionality must remain in the application domain in which it was created (that is, on the server).
Please refer the below link
http://www.codeproject.com/Articles/14791/NET-Remoting-with-an-easy-example
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=383
Thanks