IT Community - Software Programming, Web Development and Technical Support

.NET Remoting

This is a discussion on .NET Remoting within the C# Programming forums, part of the Software Development category; What is .Net Remoting? Can any one explain it...?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2007, 07:19 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 905
S.Vinothkumar is on a distinguished road
Question .NET Remoting

What is .Net Remoting?

Can any one explain it...?
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 08-17-2007, 07:21 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 200
krishnakumar is on a distinguished road
Default Re: .NET Remoting

Hi,
.NET remoting is replacement of DCOM. Using .NET remoting you can make remote object calls which lie in different Application Domains. As the remote objects run in different process client calling the remote object can not call it directly. So the client uses a proxy which looks like a real object.
When client wants to make method call on the remote object it uses proxy for it. These method calls are called as “Messages”. Messages are serialized using “formatter” class and sent to client “channel”. Client Channel communicates with Server Channel. Server Channel uses as formatter to deserialize the message and sends to the remote object.
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 08-17-2007, 07:23 AM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 245
H2o is on a distinguished road
Question Re: .NET Remoting

Which class does the remote object has to inherit ?
__________________
H2O

Without us, no one can survive..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 08-17-2007, 07:25 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 200
krishnakumar is on a distinguished road
Wink Re: .NET Remoting

Hi,
All remote objects should inherit from System.MarshalbyRefObject.
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 08-17-2007, 07:27 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 319
amansundar is on a distinguished road
Question Re: .NET Remoting

What are two different types of remote object creation mode in .NET ?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 08-17-2007, 07:29 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 200
krishnakumar is on a distinguished road
Wink Re: .NET Remoting

Hi aman,

√ SAO (Server Activated Objects) also called as Well-Known call mode.
√ CAO (Client Activated Objects)

SAO has two modes “Single Call” and “Singleton”. With Single Call object the object is created with every method call thus making the object stateless. With Singleton the object is created only once and the object is shared with all clients.
CAO are stateful as compared to SAO. In CAO the creation request is sent from client side. Client holds a proxy to the server object created on server.
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 08-31-2007, 01:36 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Smile Re: .NET Remoting

Quote:
Originally Posted by S.Vinothkumar View Post
What is .Net Remoting?

Can any one explain it...?
In Microsoft .Net there are some advanced concepts of enterprises services available, like Web Services and .Net Remoting.

ASP.NET Web services and .NET remoting are two separate paradigms for building distributed applications using Internet-friendly protocols and the .NET framework.

Web services typically use SOAP for the message format and require that you use IIS for the HTTP message transport. This makes Web services good for communication over the Internet, and for communication between non-Windows systems. Web services are a good choice for message-oriented services that must support a wide range of client platforms and a potentially heavy load.

Remoting can be configured to use either SOAP or Microsoft's proprietary binary protocol for communication. The binary protocol yields higher performance, and is great for .NET to .NET communication, but cannot be used to communicate with non-Windows platforms. Remoting does not require an IIS Web server, making it a good choice for peer-to-peer development, but this also means that it cannot leverage the scalability and performance of IIS to support a high number of connections or requests per second.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 09-06-2007, 07:10 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 200
krishnakumar is on a distinguished road
Smile Re: .NET Remoting

Hi,

Is .Net remoting is similar to webservices.....
What kind of relation between .net remoting and webservices.....

CAn any one tell me....
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 09-19-2007, 12:38 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Question Re: .NET Remoting

Is any sample code for Remoting using C#?
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 09-19-2007, 01:38 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 905
S.Vinothkumar is on a distinguished road
Wink Re: .NET Remoting

Hi saravana!

check with the following...

Remoting is a framework built into Common Language Runtime (CLR) in order to provide developers classes to build distributed applications and wide range of network services. Remoting provides various features such as Object Passing, Proxy Objects, Activation, Stateless and Stateful Object, Lease Based LifeTime and Hosting of Objects in IIS. I’m not going into detail of these features because it will take 3 to 4 tutorials. Here I’m presenting a simple client/server based application in order to provide you easy and fast hands on Remoting.

Remoting Object

This is the object to be remotely access by network applications. The object to be accessed remotely must be derived by MarshalByRefObject and all the objects passed by value must be serializable.

Code:
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace RemotingSamples
{
    public class RemoteObject : MarshalByRefObject
    {
        //////////////////////////////////////////////////////////////////////////////
        ///constructor
        public RemoteObject()
        {
            Console.writeline("Remote object activated");
        }
    
        //////////////////////////////////////////////////////////////////////////////
        ///return message reply
        public String ReplyMessage(String msg)
        {
            Console.WriteLine("Client : "+msg);//print given message on console 
            return "Server : Yeah! I'm here";
        }
    }
}
The remote object must be compiled as follows to generate remoteobject.dll which is used to generate server and client executable.

Code:
csc /t:library /debug /r:System.Runtime.Remoting.dll remoteobject.cs
Server

This is the server application used to register remote object to be access by client application. First, of all choose channel to use and register it, supported channels are HTTP, TCP and SMTP. I have used here TCP. Than register the remote object specifying its type.

Code:
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace RemotingSamples
{
    public class Server
    {
        /////////////////////////////////////////////////////////////////////////////
        ///constructor
        public Server()
        {
        }
        /////////////////////////////////////////////////////////////////////////////
        ///main method
        public static int Main(string [] args)
        {
            //select channel to communicate
            TcpChannel chan = new TcpChannel(8085);
            ChannelServices.RegisterChannel(chan);    //register channel
            //register remote object
            RemotingConfiguration.RegisterWellKnownServiceType(
                Type.GetType("RemotingSamples.RemoteObject,object"),
                "RemotingServer",
                WellKnownObjectMode.SingleCall);
            //inform console
            Console.WriteLine("Server Activated");

            return 0;
        }
    }
}
The server must be compiled as follows to produce server.exe.

Code:
csc /debug /r:remoteobject.dll /r:System.Runtime.Remoting.dll server.cs
Client

This is the client application and it will call remote object method. First, of all client must select the channel on which the remote object is available, activate the remote object and than call proxy’s object method return by remote object activation.

Code:
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using RemotingSamples;

namespace RemotingSamples
{
    public class Client
    {
        /////////////////////////////////////////////////////////////////////////////
        ///constructor
        public Client()
        {
        }

        //////////////////////////////////////////////////////////////////////////////
        ///main method
        public static int Main(string [] args)
        {
            //select channel to communicate with server
            TcpChannel chan = new TcpChannel();
            ChannelServices.RegisterChannel(chan);
            RemoteObject remObject = (RemoteObject)Activator.GetObject(
                typeof(RemotingSamples.RemoteObject),
                "tcp://localhost:8085/RemotingServer");
            if (remObject==null)
                Console.WriteLine("cannot locate server");
            else
                remObject.ReplyMessage("You there?");

            return 0;
        }
    }
}
The client must be compiled as follows in order to produce client.exe

Code:
csc  /debug  /r:remoteobject.dll  /r:System.Runtime.Remoting.dll  client.cs
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
When would we use .NET Remoting and when Web services? krishnakumar ASP and ASP.NET Programming 8 04-12-2008 12:13 AM
security measures for .NET Remoting Arun ASP and ASP.NET Programming 1 08-17-2007 11:15 PM
What is .NET Remoting ? oxygen ASP and ASP.NET Programming 4 08-08-2007 01:37 AM
What are the situations we have to use a Web Service and Remoting in projects in asp. oxygen ASP and ASP.NET Programming 1 07-26-2007 03:00 AM
Flash Remoting nssukumar Flash Actionscript Programming 3 03-20-2007 04:28 AM


All times are GMT -7. The time now is 01:13 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0