.NET Remoting Chandra sekhar Chandra sekhar. What is.NET Remoting? What is.NET Remoting?.NET Remoting versus Distributed COM..NET Remoting versus Distributed.

Slides:



Advertisements
Similar presentations
.Net Remoting by James Stone. What is.Net Remoting? RemotingRemoting is a technology that allows.NET applications to communicate. Remoting Same machine,
Advertisements

Distributed Applications By Sam Nasr, MCP
COM vs. CORBA.
Copyright © 2002 Landl Software, Inc. All Rights Reserved. Twin Cities.NET Users Group Next Meeting - Thursday, April 4, 2002 A Look Inside Reflection.
.NET Remoting in Delphi and C# Alain “Lino” Tadros President & CEO Falafel Software Inc. ComponentScience Inc. BORCON 2004.
.Net Remoting Pooja Panjala 06/17/10. Agenda What is.net Remoting? Explanation of terms Architecture Implementation of Remoting Sample example.net Security.
C# and Windows Programming Application Domains and Remoting.
.NET REMOTING CertSIG Tom Perkins. FUNDAMENTALS Distributed Applications Process A Process B Process C Objects can communicate across process boundaries.
Author: Bill Buchanan. Authentication (to identify the clients of your application) Authorization (to provide access controls for those clients) Secure.
.NET Remoting. .Net Remoting Replaces DCOM (Distributed Component Object Model – a proprietary Microsoft technology for communication among software components.
Remote Method Invocation
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
Windows Communication Foundation and Web Services.
1 Advanced Programming Topics - II Objectives:  Background  Remoting  Types of remoting  Marshalling  Farmatters  Channels.
.Net Remoting Jim Fawcett CSE775 – Distributed Objects Spring 2004.
Securing and Sharing Files Over The Internet (Content Server Security) By Amihay Schwarz Instructor: Viktor Kulikov Software System Laboratory Department.
Distributed Systems Tutorial 2 -.NET Remoting. 2 What is Remoting?  Remoting allows you to pass objects or values across servers in different domains.
.NET Deployment Matt Smouse CSE775 – Distributed Objects Spring 2003.
.NET Remoting A Distributed Application Cookbook.
Distributed Systems Tutorial 3 -.NET Remoting – Crossing Application Boundaries.
Chapter 15 Remoting Yingcai Xiao. ASP.NET is for building traditional thin- client applications (Web applications). Such applications rely on browsers.
I NTRODUCTION OF S OCKET P ROGRAMMING L.Aseel AlTurki King Saud University.
Process-to-Process Delivery:
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
CIS NET Applications1 Chapter 10 – Remoting.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
.NET Remoting Architecture. Slide 2 CITE 4420.NET Remoting Topics Remoting Boundaries Crossing the Boundaries Distributed Applications Marshalling Channels.
.Net Remoting. 2 Distributed Computing under.Net In.Net, there are three levels of access to distributed computing machinery: In.Net, there are three.
RMI Components java.rmi: client-side RMI classes, interfaces, and exceptions java.rmi.server: server-side RMI classes, interfaces, and exceptions java.rmi.registry:
Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT.
Lector: Aliyev H.U. Lecture №6 Design of client-server communication software. TCP-based network programming TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES.
Distributed Communication via ASP.Net Web Services and.Net Remoting By Richard King.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Develop Distributed Applications using.NET Remoting Kate Gregory Regional Director Gregory Consulting Limited
Presentation 23.NET Remoting Introduced. Ingeniørhøjskolen i Århus Slide 2 af 20 Outline.NET Framework introduced.NET Remoting strategies Architecture.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Distributed Application Development Prepared By: Ruwan Wijesinghe.
Copyright © 2003, developerLabs Extending.NET Distributed Applications Stephen Fulcher developerLabs.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
.Net Remoting The Other RPC Architecture Doug Gregory October 27, 2003.
1 Nordjyllands Erhvervakademi Net Remoting Architecture Marshalling –Marshalling By Reference(MBR) –Marshalling By Value(MBV) Activation by MBR.
ZOOKEEPER. CONTENTS ZooKeeper Overview ZooKeeper Basics ZooKeeper Architecture Getting Started with ZooKeeper.
Alexey Polovinkin Post graduate student, CMC department.
.NET Remoting. Remoting Introduction The process of programs or components interacting across certain boundaries either different processes or machines.
Windows Communication Foundation and Web Services
Jim Fawcett CSE775 – Distributed Objects Spring 2003
Develop Distributed Applications using .NET Remoting
Presented by: Ramaswamy Krishnan-Chittur
Configuring and Hosting WCF Services
.NET Remoting Priyanka Bharatula.
Message-Passing Communication Analyzer By Poonam Bijlani CSE 775- Distributed Objects Prof. Jim Fawcett.
Programming with C# and .NET.
MCA – 405 Elective –I (A) Java Programming & Technology
The Internet.
Remote Method Invocation
Presentation 23 .NET Remoting Introduced
Advanced .NET Programming II 10th Lecture
10: Remoting Securing System.Runtime.Remoting
Matt Smouse CSE775 – Distributed Objects Spring 2003
Distribution of functionality Webservice using WCF
Presented by: Ramaswamy Krishnan-Chittur
Microsoft .NET Remoting Essentials
Windows Communication Foundation and Web Services
Knowledge Byte In this section, you will learn about:
Quiz Points 5 Rules Raise your hand if you know the question
Matt Smouse CSE775 – Distributed Objects Spring 2003
Jim Fawcett Core Technologies Spring 2005
Jim Fawcett CSE791 – Distributed Objects Spring 2002
Matt Smouse CSE775 – Distributed Objects Spring 2003
Presentation transcript:

.NET Remoting Chandra sekhar Chandra sekhar

What is.NET Remoting? What is.NET Remoting?.NET Remoting versus Distributed COM..NET Remoting versus Distributed COM..NET Remoting versus Web Services..NET Remoting versus Web Services.

To use.NET remoting to build an application in which two components communicate directly across an application domain boundary, you need to build the following: A remotable object. A host application domain to listen for requests for that object. A client application domain that makes requests for that object.

The server process has to register the remotable class so that it can be activated from another application domain. The.NET distinguishes between 2 types of remotable objects: 1)Server-activated objects :Server-activated objects are registered with RemoteConfigurations RegisterWellKnownServiceType and RegisterWellKnownClientType methods 2)Client-activated object. Client-Activated objects are registered with RegisterActivatedServiceType and RegisterActivatedClientType

1) RegisterWellKnownServiceType RemotingConfiguration.RegisterWellKnownServiceType( typeof(RemotableClass), // Remotable Class “RemotableObject”,//URI of remotable class WellKnownObjectMode.SingleCall//Activation Mode OrWellKnownObjectMode.Singleton);

2) RegisterActivationServiceType RemotingConfiguration.RegisterActivatedSer viceType( typeof(HelloServiceClass), //Remotable Class ");

To make RemotableClass available to remote clients, the server process must also create and register a channel. To make RemotableClass available to remote clients, the server process must also create and register a channel. The channel provides a conduit for communication between an object and a remote client. The channel provides a conduit for communication between an object and a remote client. The.NET Framework class library includes two channels for use on the server side : The.NET Framework class library includes two channels for use on the server side : a) System.Runtime.Remoting.Channels.Tcp.TcpServerChannel b) System.Runtime.Remoting.Channels.Http.HttpServerChannel

A client application that wants to create a remote instance of RemotableClass has to do some registration of its own. The.NET provides two client channel types:TCPClientChannel and HttpClientChannel A client application that wants to create a remote instance of RemotableClass has to do some registration of its own. The.NET provides two client channel types:TCPClientChannel and HttpClientChannel RemotingConfiguration.RegisterWellKnownClientType registers a class on the client that’s registered with RemotingConfiguration.RegisterWellKnownServiceType on the server. RemotingConfiguration.RegisterWellKnownClientType registers a class on the client that’s registered with RemotingConfiguration.RegisterWellKnownServiceType on the server. The following statements create and register a client-side TCP channel. The following statements create and register a client-side TCP channel. TcpClientChannel channel = new TcpClientChannel (); ChannelServices.RegisterChannel (channel); RemotingConfiguration.RegisterWellKnownClientType ( typeof (RemotableClass),//Remotable Class “tcp://localhost:1234/RemoteObject”//URL of remotable class. );

Server side: RemotingConfiguration.configure(“TimeServer.exe.cinfig”);TimeServer.exe.config<configuration> <wellknown mode="SingleCall" type="Clock, ClockServer" <wellknown mode="SingleCall" type="Clock, ClockServer" objectUri="Clock" /> objectUri="Clock" /> </configuration> Declarative Configuration

Client side RemotingConfiguration.Configure ("TimeClient.exe.config"); TimeClient.exe.config<configuration> <wellknown type="Clock, ClockServer" <wellknown type="Clock, ClockServer" url="tcp://localhost:1234/Clock" /> url="tcp://localhost:1234/Clock" /> </configuration>

In the server activated objects when the client calls new only a proxy is created. The objects themselves aren’t created until a method call is placed through the proxy. In the server activated objects when the client calls new only a proxy is created. The objects themselves aren’t created until a method call is placed through the proxy. The Client activated objects are created on the server the moment the client calls new. The Client activated objects are created on the server the moment the client calls new. Every client that creates a client-activated object receives a brand new object instance that is unique to that client. Every client that creates a client-activated object receives a brand new object instance that is unique to that client. Server-Activated Vs Client-Activated

OBJECT LEASING OBJECT LEASING How long does a remote object live once its activated? How long does a remote object live once its activated? Singleton server-activated objects and client-activated objects lifetimes are controlled by leases that can be manipulated programmatically Singleton server-activated objects and client-activated objects lifetimes are controlled by leases that can be manipulated programmatically A lease is an object that implements the ILease interface defined in System.Runtime.Remoting.Lifetime namespace A lease is an object that implements the ILease interface defined in System.Runtime.Remoting.Lifetime namespace ILease lease = (ILease) base.InitializeLifetimeService(); If(lease.CurrentState == LeaseState.Initial) { Lease.InitialLeaseTime = TimeSpan.FromMinutes(20); Lease.RenewOnCallTime = TimeSpan.FromMinutes (10); } Return lease;

Lease Property InitialLeaseTime : Length of time following the activation that the object lives if it receives no method calls. InitialLeaseTime : Length of time following the activation that the object lives if it receives no method calls. RenewOnCallTime : Minimum value that CurrentLeaseTime is set to each time the object receives a call. RenewOnCallTime : Minimum value that CurrentLeaseTime is set to each time the object receives a call. CurrentLeaseTime : Amount of time remaining before the object is deactivated if it doesn’t receive a method call. CurrentLeaseTime : Amount of time remaining before the object is deactivated if it doesn’t receive a method call.

<configuration> </configuration> SETTING LEASE DECLARATIVELY

TO RENEW LEASE RemotableClass rc = new RemotableClass(); ILease lease = (ILease) RemotingServices.GetLifetimeService (rc); TimeSpan remaining = lease.CurrentLeaseTime; If(remaining.ToltalMinutes <1.0) lease.Renew(TimeSpan.FromMinutes(10));

Http Channels and Binary Formatters To use IIS we need HTTP Channels to link application domains. To use IIS we need HTTP Channels to link application domains. We can replace the ClientFormatterSinkProvider and SoapServerFormatterSinkProvider with BinaryClientFormatterSinkProvider and BinaryServerFormatterSinkProvider We can replace the ClientFormatterSinkProvider and SoapServerFormatterSinkProvider with BinaryClientFormatterSinkProvider and BinaryServerFormatterSinkProvider The following Web.config registers Clock to be activated by IIS as a singleton server-activated object. The following Web.config registers Clock to be activated by IIS as a singleton server-activated object.

<wellknown mode="Singleton" type=“Clock, ClockServer" <wellknown mode="Singleton" type=“Clock, ClockServer" objectUri=“Clock.rem" /> objectUri=“Clock.rem" />