[Mono-list] Q: Problem with remoting ?

Michael Erdmann Michael.Erdmann@snafu.de
Fri, 21 May 2004 17:38:25 +0200


Dear all,

i have copied the attached remoting test programs from the net and
tested it on a windows XP Box and a Linux system with the latest mono
rpm. Windows works fine, Mono does not work!

It this a known Problem, a limitation since remoting seems to be 
implemented for 99% or simply a bug?

namespace Test.Log
{
    using System;
 
    public class Logger : MarshalByRefObject
    {
        public void Log(String aString)
        {
            Console.WriteLine(aString);
        }
    }
}

namespace Test.Server
{
    using System;
    using System.Runtime.Remoting;
    using System.Runtime.Remoting.Channels;
    using System.Runtime.Remoting.Channels.Http;
    using System.Runtime.Remoting.Channels.Tcp;
    using Test.Log;
 
    public class Server
    {
        public static void Main()
        {
            ChannelServices.RegisterChannel(new HttpChannel(8010));
            ChannelServices.RegisterChannel(new TcpChannel(8011));
 
            RemotingConfiguration.RegisterWellKnownServiceType(
                typeof(Logger), "Log", WellKnownObjectMode.Singleton);
 
            Console.WriteLine("Press enter to stop the server...");
            Console.ReadLine();
        }
    }
}
namespace Test.Client
{
    using System;
    using System.Runtime.Remoting;
    using Test.Log;
 
    public class Client
    {
        public static void Main(string[] args)
        {
            //Logger httpLogger =
            //    (Logger)Activator.GetObject(
            //      typeof(Logger), "http://localhost:8010/Log");
            Logger tcpLogger =
                (Logger)Activator.GetObject(
                  typeof(Logger), "tcp://localhost:8011/Log");
 
            Console.WriteLine("Executing requests");
            //httpLogger.Log("HTTP Client Request");
            tcpLogger.Log("TCP Client Request");
        }
    }
}