TechBubbles

Overview of .NET Remoting

Introduction

This post provides you the overview of .NET Remoting Framework. It allows the objects to interact with one another across the application domains.

Features

  • Communication channels for transporting messages across applications
  • Formatters are used for encoding and decoding the messages. supported formatters are

                 1. Binary encoding formatter – use when performance is critical

                 2. XML encoding formatter = use when Interoperability is essential

  •   Object activation and life-time support

           Object activation model falls into two categories

        1.Client-activated objects

       2.Server-activated objects

Remote Objects

An object is consider to be remote when the caller of the object is in different application domain. Object has to decorate with [serializable] custom attribute or they have to implement ISerializable interface to be considered as a remote. Remote objects have to be passed by value. Any object can be changed to remote by deriving from MarshalByRefObject.

Proxy Objects

Proxy Objects are created when client activates a remote object. Proxy object acts as a representative to remote object and ensures that all calls that made on proxy are  forwarded to the remote object.

Two types of Proxy Objects

1.Transparent Proxy

2.Real Proxy

when client activates a remote object, Framework creates a local instance of TransparentProxy class. All method calls on Transparent Proxy object are intercepted by CLR and forwards the call if the remote object is in same application domain.

Real Proxy object calls are intercepted by CLR and forwards the call even the remote object is in different application domain by calling its Invoke method.

Read more

Related Posts:

2 comments

Remoting in .NET Framework 2.0

Introduction

Remoting is  distributed application technology built in the Framework 2.0 with new features which allows the developer to build wide range of distributed applications. Overview of Remoting.

Introduced some new features in Remoting in .NET FW 20. The applications are now more secured and performanent.

Enhancement in the Channel infrastructure: The new channel IPC is introduced which enables the same box communication. It allows the communication between both server application and client application when both are in the same machine. This wont use any network layer when client and server communicate. IPC Channel is based on named pipes.

IPC channel don’t use ports unlike TCP and HTTP channels. The URI will look like ipc://test/server.rem.

.NET FW 2.0 supports three channels in communication – TCP,HTTP and IPC and it supports two formatters, Binary and SOAP.

.NET Remoting Server application can be in the following forms

  • Console application
  • Windows application
  • Windows Service
  • IIS(using HTTP and Binary Formatter)

Interface

Interface Implementation in Server Application

 

Client Application

Client 

Application Configuration file settings

 

App

We can limit the number of users by using this channel.

Related Posts:

1 comment