[Mono-bugs] [Bug 59835][Nor] New - Cannot use Remoting between Linux & Windows systems

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 8 Jun 2004 16:52:28 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by clintp_bugzilla@geeksalad.org.

http://bugzilla.ximian.com/show_bug.cgi?id=59835

--- shadow/59835	2004-06-08 16:52:28.000000000 -0400
+++ shadow/59835.tmp.18442	2004-06-08 16:52:28.000000000 -0400
@@ -0,0 +1,163 @@
+Bug#: 59835
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: Windows/Linux interaction
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: clintp_bugzilla@geeksalad.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Cannot use Remoting between Linux & Windows systems
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+Using MCS 0.95 and Mono 0.95 the following client/server pair works fine 
+(shortened example from ORA's Programming C#) as long as the client and 
+the server are on the same architecture.
+
+Server Client
+  Linux-Linux        OK
+Win32-Win32 (2k) OK
+  Linux-Win32       Fails
+Win32-Linux         Cannot test, firewalls
+
+The error that is thrown in the client is:
+    "The object with ID 1 was referenced in a fixup but does not exist."
+
+When running the client under Windows and the server under Linux.  The 
+error occurs at the line:
+
+     double sum = calc.Add((double)3.0, (double)4.0);
+
+
+Steps to reproduce the problem:
+  ** These steps assume a Linux server, Windows Client **
+1. Compile this code to a DLL named ICalc.dll on the Windows system.  
+
+using System;
+namespace MyServer
+{
+    public interface ICalc
+    {
+        double Add(double x, double y);
+        double Mult(double x, double y);
+    }
+
+}
+
+2. Move the DLL to the Linux system
+3. Compile this code on the Linux system, using the DLL in step 1 as a 
+resource:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+namespace MyServer
+{
+       public class Calculator : MarshalByRefObject, ICalc
+       {
+                public Calculator()
+                {
+                        Console.WriteLine("Calculator Constructor...");
+                }
+                public double Add(double x, double y)
+                {
+                        Console.WriteLine("Called add...");
+                        return x + y;
+                }
+                public double Mult(double x, double y)
+                {
+                        Console.WriteLine("Called mult...");
+                        return x * y;
+               }
+        }
+        public class ServerTest
+        {
+                public static void Main()
+                {
+                        HttpChannel chan = new HttpChannel(65100);
+                        ChannelServices.RegisterChannel(chan);
+                        Type calcType =
+                                Type.GetType("MyServer.Calculator");
+                        
+RemotingConfiguration.RegisterWellKnownServiceType
+                                (calcType, "theEndPoint",
+                                        WellKnownObjectMode.SingleCall);
+                        Console.WriteLine("Press [enter] to exit...");
+                        Console.ReadLine();
+                }
+        }
+}
+
+
+4. Compile this code on the Windows system -- changing the IP address to 
+the Linux server's -- using the DLL in step 1 as a resource:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+namespace MyServer
+{
+        class Class1
+        {
+                [STAThread]
+                static void Main(string[] args)
+                {
+                        HttpChannel chan = new HttpChannel(0);
+                        ChannelServices.RegisterChannel(chan);
+                        MarshalByRefObject obj = (MarshalByRefObject)
+                                        
+RemotingServices.Connect(typeof(MyServer.ICalc),
+                                                
+"http://linux.server.ip.address:65100/theEndPoint");
+                        try
+                        {
+                                MyServer.ICalc calc = obj as 
+MyServer.ICalc;
+                                double sum = calc.Add((double)3.0, 
+(double)4.0);
+                                Console.WriteLine("Sum: " + sum.ToString
+());
+                        }
+                        catch (System.Exception ex)
+                        {
+                                Console.WriteLine("Exception caught: \n" 
++ ex.Message);
+                        }
+                        return;
+                }
+        }
+}
+
+5. Start the Linux server (you may want to verify that it is bound to 
+port 65100)
+
+6. Start the Windows client, wait for error message.
+
+Actual Results:
+Error thrown on client side:
+    "The object with ID 1 was referenced in a fixup but does not exist."
+
+Expected Results:
+7
+
+How often does this happen? 
+Every time.
+
+Additional Information:
+This is the example for remoting over HTTP taken from ORA's Programming 
+C#.  (Somewhat reduced in size, but the same example essentially.)
+
+This example works fine when *both* server and client are run on the same 
+architecture.