IntroductionThe application is a simple Chat server and Client, which is conversion of Java RMI chat server and client. The Java client was a Applet and present application client in WinForm.You can find the original Java code from [Troy Downing [email protected] http://www.webcal.com/downing/ February 1997]Technology UsedSerialization, RemotingSerialization : Serialization is the process of converting a graph of objects, into a linear sequence of bytes. That sequence of bytes can be sent elsewhere (for example, to a remote computer) and Deserialized, thereby making a clone in that remote memory of the original graph of objects. Serialization is necessary in this application to have the state of the Remote Object on the client and server at the same time.Remoting : Microsoft .NET Remoting provides a rich and extensible framework for objects living in different AppDomains, in different processes, and in different machines to communicate with each other seamlessly. .NET Remoting offers a very powerful yet simple programming model and runtime support for making these interactions transparent.NET Remoting Objects There are three types of objects that can be configured to serve as .NET remote objects. You can choose the type of object depending on the requirement of your application. This section explains these objects in detail. "Single Call" objects service one and only one request coming in. Single call objects are useful in scenarios where the objects are required to do a finite amount of work and usually not required to store state information. Single Call objects can be configured in a load-balanced fashion. Single Call Objects cannot hold state information between method calls. "Singleton" Objects are those objects that service multiple clients and hence share data by storing state between client invocations. They are useful in cases where data needs to be explicitly shared between clients and also where the overhead of creating and maintaining objects is substantial.In the sample we have to use singleton because of the nature of the application. Client Activated Objects (CAO) are server side objects that are activated on request from the client. This way of activating server objects is very similar to the classic COM coclass activation. When the client requests for a server object using "new" operator, an activation request message is sent to the remote application. The server then creates an instance of the requested class and returns an ObjRef back to the client application that invoked it. A proxy is then created on the client side using the ObjRef. The client's method calls will be executed on the proxy. Client Activated Objects can store state information between method calls for its specific client and not across different client objects. Each invocation of "new" returns a proxy to an independent instance of the server type. Passing Objects Using .NET Remoting In .NET Remoting, objects can be passed from one application to another in the following ways:
For objects that are Marshal By Value (MBV), a complete copy of the object is made when the object is passed from one application to another.
Channel Services (System.Runtime.Remoting.Channels)
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: