Re: Can't connect to remote object

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Sam Santiago (ssantiago_at_n0spam-SoftiTechture.com)
Date: 10/11/04


Date: Mon, 11 Oct 2004 14:11:15 -0700

Trying starting with this example from Microsoft Quickstart examples:

http://samples.gotdotnet.com/quickstart/howto/doc/remoting/mainfeatures.aspx

Thanks,

Sam

-- 
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
"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
>
>
>
>


Relevant Pages

  • Re: Naming Convention help - Beyond the basics?
    ... MyClass _myClass; ... Here's a poor style solution - you have a variable that's one case off ... public void Foo ... private string _name; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .Net Remoting
    ... You're more likely to get an answer to your question in the remoting ... newsgroup, ... > public class MyClass: MarshalByRefObject ... > public void DoSomething() ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: define and call methods in ruby
    ... public void setName ... public class anotherclass extends myclass ... what I'm trying to do is declare similar method as printMessagein ruby. ...
    (comp.lang.ruby)
  • Re: Thread related question
    ... just looking for advice from the experienced...so not sure ... ArrayBlockingQueue is what i was looking for. ... public MyClass(){} ... public void run{ ...
    (comp.lang.java.programmer)
  • Cant connect to remote object
    ... public class MyClass: MarshalByRefObject ... but when i try to invoke a method of my remote class, ... can't connect to remote object ... ...
    (microsoft.public.dotnet.framework.remoting)