Remoting is one of the important and advance features in
.NET, which is an infrastructure used to provide inter-process or cross domain
communication. Instead of giving the definition and theoretical explanations of
its component, I will describe the practical uses and take-care points which we
must know to successfully implement remoting applications using .NET. I have
used Visual Basic 2005 for examples in this article.
As we know, in general we should have three components to
develop remote system.
·
A remotable object (classes which defines remote methods)
·
A remote server host which can listen client request for the
object on a given port
·
A remote client application which can request to the host server
to call remote methods
·
A remote server host and client application could be any
application like console, windows application, or windows server. In my example
I will use console application for both.
Let us come to the major part of Remoting - remotable
object. You must know that there are two main types of remotable object.
Marshal-by-value
We use it for cross process communication usually in the
same domain, in LAN, or in our daily programming on the call by value concept.
Marshal-by-reference (MarshalByRefObject in .NET)
We use it in remoting for cross domain communication usually
over WAN or internet on the call by reference concept.
MarshalByRef objects can be activated in two ways:
Server Activation (SAO)
·
SAO-SingleCall
·
SAO-Singleton
Client Activation (CAO)