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...?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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! |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| Which class does the remote object has to inherit ?
__________________ H2O Without us, no one can survive.. |
|
#4
| |||
| |||
| 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 |
|
#5
| |||
| |||
| What are two different types of remote object creation mode in .NET ?
__________________ cheers Aman |
|
#6
| |||
| |||
| 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 |
|
#7
| |||
| |||
| 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. |
|
#8
| |||
| |||
| 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 |
|
#9
| |||
| |||
| Is any sample code for Remoting using C#?
__________________ J.Saravanan |
|
#10
| |||
| |||
| 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";
}
}
} Code: csc /t:library /debug /r:System.Runtime.Remoting.dll remoteobject.cs 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;
}
}
} Code: csc /debug /r:remoteobject.dll /r:System.Runtime.Remoting.dll server.cs 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;
}
}
} 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! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |
Our Partners |