Ken Kolda
10/11/2004 9:10:00 PM
Your client app is using a server channel. In general, I never specifically
use the HttpServerChannel/HttpClientChannel -- I just use HttpChannel on
both client and server and let the remoting system do the rest.
Ken
"SOS" <SOS@dd> wrote in message
news:emQxND9rEHA.1644@tk2msftngp13.phx.gbl...
> hi guys ,
>
> i'm trying to learn how to use .Net Remoting !
> i created a class like this :
>
>
> public class MyClass : MarshalByRefObject
>
> {
>
> public MyClass()
>
> {
>
> Console.WriteLine("my object created !");
>
> }
>
>
>
>
>
> public void DoSomething()
>
> {
>
> // do sometthing here
>
> }
>
> }
>
>
>
> and i use of a windows application to register this class :
>
>
>
> public void Main()
>
> {
>
> HttpServerChannel channel = new HttpServerChannel(8080);
>
> ChannelServices.RegisterChannel(channel);
>
>
>
>
>
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyClass),"MyClass"
> ,WellKnownObjectMode.Singleton);
>
> MessageBox.Show("Registered !");
>
> }
>
>
>
> and finally , i use of this code to access the remote object.
> but when i try to invoke a method of my remote class , this error occure :
> can't connect to remote object ...
>
>
>
> public void Main()
>
> {
>
> ChannelServices.RegisterChannel(new HttpServerChannel());
>
>
>
> MyClass myclass = (MyClass)
> Activator.GetObject(typeof(MyClass),"http://localhost:8080/MyClass");
>
> if (myclass != null)
>
> {
>
> myclass.DoSomething();
>
> }
>
>
>
> }
>
>
>
> what's wrong ?
>
> Thanx
>
>
>
>