0% found this document useful (0 votes)
151 views13 pages

Remoting

This document discusses distributed applications in C# using .NET remoting. It covers the basic modes of operation including socket programming, web services, and remoting. The bulk of the document focuses on .NET remoting, describing the major elements involved like remote objects, channels, messages, formatters, and proxies. It provides examples of how to create a simple remote object, server, and client as well as how to pass objects between remote methods.

Uploaded by

api-26312742
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
151 views13 pages

Remoting

This document discusses distributed applications in C# using .NET remoting. It covers the basic modes of operation including socket programming, web services, and remoting. The bulk of the document focuses on .NET remoting, describing the major elements involved like remote objects, channels, messages, formatters, and proxies. It provides examples of how to create a simple remote object, server, and client as well as how to pass objects between remote methods.

Uploaded by

api-26312742
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

Distributed Applications in C#

1
Basic Modes of Operation

 Socket Programing
 Web Services
 Remoting using .NET

2
Remoting using .NET

 We will primarily concerned about creating


.NET Remoting objects , servers, clients using
http and tcp channel with the SOAP and binary
formatter .
 .Net remoting classes can be found in
System.Runtime.Remoting and its sub
namespaces .
 Most of the classes defined in mscorelib
 Other cross-network communication classes can be
found in the specified namespace .

3
.NET Remoting Overview

 .NET Remoting can be used to access objects in


another application domain
 If the assembly is the part of the remote application ,
the client receives a proxy instead of the real object .
 The proxy sends the message into the channel that is
passed to
the remote object .

4
.NET Remoting Overview

 Majore Elements :
 remote object
Object running on the server .
Must be derived from MarshalByRefObject
 Channel
Used to communicate with server
Can be tcp/http
 Message
These are sent into the channel
It holds the information about
Remote Object
methode name called
all of its argument

5
.NET Remoting Overview

 Majore Elements (contd..)


 formatter
defines how messages are transferred into the
channel
SOAP and binary
 formatter provider
associate a formatter with a channel .
 proxy
transparent proxy
real proxy

6
.NET Remoting Overview

 Majore Elements (contd..)


 message sink
an interceptor object present in both client and
server side .
real proxy uses sink to place message into the
channel.
depending on where the sink is used , it is known as
an envoy sink , server context sink , object context
sink .
 activator
client uses this to get a proxy of the real object .
 utility classes
RemotingConfiguration
ChannelServices
7
A Simple Example

 Remote Object
 Remote Server
 Remote Client

8
.NET Architecture

 Majore Elements (contd..)


 ChannelServices
RegisterChannel
GetChannel
 RemotingConfiguration
Register<WellKnown/Activated><Service/Client
>Type
For Client Activated :
ServiceType
Specify ApplicationName
Register only with type of remoted object
ClientType :
typeof(Hello),
“tcp://localhost:8086/HelloServer” 9
.NET Architecture

 Majore Elements (contd..)


 Activator
GetObject for well known object
CreateInstance for client activated object .

10
.NET Architecture

 Passing object in remote method


 Marshal-by-value
Serialized object
Either implement ISerializable or use attribute
[Serializable]
These objects do-not have remote identity
also called unbound class .

11
.NET Architecture

 Passing object in remote method


( cont..)
 Marshal-by-ref
Need to extend MarshalByRefObject
Do have a remote identity
 Classes neither serialized nor derived from
MarshalByRefObject can not be used as
parameter in public method of
RemoteObject .

12
Asynchronous Remoting

 Using Event in Remoting


 Demonstration by example .

13

You might also like