Upload
pradeep-sripada
View
188
Download
2
Tags:
Embed Size (px)
Citation preview
Session 7
.NET Remoting II
.NET Remoting II/ 2 of 21
Session Objectives Discuss the three types of Remoting
classes Explain passing objects to remote
methods Explain asynchronous calls to a
remote method Discuss Lifetime management
in .NET Remoting
.NET Remoting II/ 3 of 21
Passing objects to Remote methods (1)
In .NET remoting, the classes of the objects that can be passed as parameters to remote methods arecategorized as –
Marshal by reference Marshal by value Non-Remotable
.NET Remoting II/ 4 of 21
Passing objects to Remote methods (2) Example 1 -
Contd…
.NET Remoting II/ 5 of 21
Passing objects to Remote methods (3)
Contd…
.NET Remoting II/ 6 of 21
Inheriting from class System.MarshalByRefObject Example 2 -
Contd…
.NET Remoting II/ 7 of 21
Inheriting from class System.MarshalByRefObject
Contd…
.NET Remoting II/ 8 of 21
Methods that return objects Example 3 -
.NET Remoting II/ 9 of 21
Remoting Server Example 4 -
.NET Remoting II/ 10 of 21
Building a client Example 5 -
.NET Remoting II/ 11 of 21
Output After executing example 4
followed by example 5
.NET Remoting II/ 12 of 21
Executing the client Client console in example 5 will
resemble -
.NET Remoting II/ 13 of 21
Asynchronous Remoting
Client makes a call to a method and then continues to perform other tasks
When the server is available it processes the method and returns the result to the client at a later time
.NET Remoting II/ 14 of 21
Asynchronous Remoting Example 6 -
.NET Remoting II/ 15 of 21
Lifetime Management -1 Lifetime management holds good
for clients that are activated as Singleton objects
Properties configured for Lifetime management -
.NET Remoting II/ 16 of 21
Lifetime Management -2 Example 7 -
Contd…
.NET Remoting II/ 17 of 21
Contd…
Lifetime Management -3
.NET Remoting II/ 18 of 21
Lifetime Management -4 Modification -
.NET Remoting II/ 19 of 21
Example 5 - Modified Example 8 -
Contd…
.NET Remoting II/ 20 of 21
Example 5 - ModifiedContd…
.NET Remoting II/ 21 of 21
Example 8 - Output