C# Remoting Architecture
The .NET Remoting provides an inter-process communication between Application Domains by using Remoting Framework. The applications can be located on the same computer , different computers on the same network, or on computers across separate networks. The .NET Remoting supports distributed object communications over the TCP and HTTP channels by using Binary or SOAP formatters of the data stream.
The main three components of a Remoting Framework are :
2. C# Remote Listener Application - (listening requests for Remote Object)
3. C# Remote Client Application - (makes requests for Remote Object)
The Remote Object is implemented in a class that derives from System.MarshalByRefObject .
You can see the basic workflow of .Net Remoting from the above figure. When a client calls the Remote method, actually the client does not call the methods directly . It receives a proxy to the remote object and is used to invoke the method on the Remote Object . Once the proxy receives the method call from the Client , it encodes the message using appropriate formatter ( Binary Formatter or SOAP Formatter ) according to the Configuration file. After that it sends the call to the Server by using selected Channel ( TcpChannel or HttpChannel ). The Server side channel receives the request from the proxy and forwards it to the Server on Remoting system, which locates and invokes the methods on the Remote Object. When the execution of remote method is complete, any results from the call are returned back to the client in the same way.
Before an object instance of a Remotable type can be accessed, it must be created and initialized by a process known as Activation. Activation is categorized in two models , they are Client-activated Objects and Server-activated Objects.
The real difference between client-activated and server-activated objects is that a server-activated object is not really created when a client instantiates it. Instead, it is created as needed.
By default the .NET Framework ships with two formatters(Binary Formatter or SOAP Formatter ) and two channels(TcpChannel ,HttpChannel).
Formatters and Channel are configured by using Configuration files. It can be easily Configured by using XML-based files.
The .NET Remoting is easy to use and powerful, largely because it is based on the Common Type System (CTS) and the Common Language Runtime (CLR). From the following link , you can understand the .Net Remoting components in detail.