[Mono-devel-list] Timeout exception

Sandra Fernandes sandrapatfer at yahoo.com
Thu Aug 28 10:14:26 EDT 2003


Hi,

I've been facing a problem in my remoting tests...
I installed version 0.26 and now I am not reaching the
server anymore.
I get a timeout exception.

I wrote a small remoting test to show you what I am
trying to do...

Could anyone give a look and try to help me?
Thanks...

-- Main.cs -- (on client)
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

namespace MonoTest
{
  public class MainClass
  {
    static public void Main ()
    {
      Console.WriteLine("*MAIN*");

      HttpClientChannel httpChannel = new
HttpClientChannel();
      ChannelServices.RegisterChannel(httpChannel);

      Console.WriteLine("-Connect-");
      ServerClassApi serverObject =
(ServerClassApi)RemotingServices.Connect (typeof
ServerClassApi),
"http://10.2.13.104/MonoServer/ServerClass.rem");

      Console.WriteLine("-Method-");
      int result = serverObject.PlusOne(20);

      Console.WriteLine("Result: {0}", result);
    }
  }
}

-- ServerClassApi.cs --
using System;

namespace MonoTest
{
  public interface ServerClassApi
  {
    int PlusOne(int i);
  }
}

-- ServerClass.cs -- (server side)
using System;
using System.Runtime.Remoting;

namespace MonoTest
{
  public class ServerClass : MarshalByRefObject,
ServerClassApi
  {
    public int PlusOne(int i)
    {
      return ++i;
    }
  }
}

-- web.config -- (server)
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.runtime.remoting>
    <application>
      <service>
        <wellknown mode="Singleton"
objectUri="ServerClass.rem"
type="MonoTest.ServerClass,ServerTest" />
      </service>
      <channels>
        <channel ref="http" />
      </channels>
    </application>
  </system.runtime.remoting>   
</configuration>



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Mono-devel-list mailing list