.Net Remoting

S

SOS

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
 
S

Steve C. Orr [MVP, MCSD]

You're more likely to get an answer to your question in the remoting
newsgroup, instead of the ASP.NET newsgroup.
microsoft.public.dotnet.framework.remoting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top