[Mono-bugs] [Bug 73173][Maj] New - Server remoting using HttpChannel will fail

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 1 Mar 2005 17:05:10 -0500 (EST)


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 ssaidwho@hotmail.com.

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

--- shadow/73173	2005-03-01 17:05:10.000000000 -0500
+++ shadow/73173.tmp.19793	2005-03-01 17:05:10.000000000 -0500
@@ -0,0 +1,132 @@
+Bug#: 73173
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Windows XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ssaidwho@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Server remoting using HttpChannel will fail
+
+Description of Problem:
+
+Mono 1.1.4, .NET 1.1
+
+Remoting server using HttpChannel object will return nothing to a .NET
+client, and will return only the first interaction with a Mono client.
+
+Steps to reproduce the problem:
+1. Run server using mono.
+2. Run client using .NET. Verify that when client makes request nothing is
+returned.
+3. Restart server using mono.
+4. Run client using Mono. Verify that when client makes first request,
+server returns result.
+5. Run client using Mono. Verify that these requests are not met with
+return from server.
+
+Steps to show working case:
+1. Run server using .NET.
+2. Run client using .NET. Verify that client gets response.
+3. Run client using .NET. Verify all subsequent requests are met with a
+response.
+
+Actual and expected results included above.
+
+How often does this happen? 
+
+Always reproducable.
+
+Additional Information:
+
+Thanks to Lance Cramlet for assisting investigation:
+
+Originally ran into problems while using XML-RPC.net. While there may be
+another bug with their client running in Mono, we focused on the server
+side problems, and, taking XML-RPC.net out, simplified the server code to
+whats included below. Server was tested after compiling with both .NET and
+mcs. mcs build command was:
+
+mcs /t:exe /out:remoteTest.exe /r:System.Runtime.Remoting.dll
+/r:RemoteObject.dll Class1.cs
+
+Server code:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+
+namespace remoteTest
+{
+	class Class1
+	{
+		[STAThread]
+		static void Main(string[] args)
+		{
+			IChannel channel = new HttpChannel(4242);
+			ChannelServices.RegisterChannel(channel);
+		
+RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject.TestObject),
+"foo", WellKnownObjectMode.SingleCall);
+			Console.ReadLine();
+			System.Environment.Exit(0);
+		}
+	}
+}
+
+Test client code:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+using RemoteObject;
+
+namespace RemotingTestClient
+{
+	class Class1
+	{
+		[STAThread]
+		static void Main(string[] args)
+		{
+			IChannel channel = new HttpChannel();
+			ChannelServices.RegisterChannel(channel);
+			TestObject test = Activator.GetObject(typeof(TestObject),
+"http://localhost:4242/foo") as TestObject;
+			Console.WriteLine(test.foo());
+			System.Environment.Exit(0);
+		}
+	}
+}
+
+Test object code:
+
+using System;
+
+namespace RemoteObject
+{
+	public class TestObject : MarshalByRefObject
+	{
+		public string foo()
+		{
+			Console.WriteLine("foo");
+			return "foo";
+		}
+	}
+}
+
+Note: We tried replacing HttpChannel with TcpChannel and found TcpChannel
+to be much more functional. Both compiled with .NET, client run with Mono,
+server run with .NET would always work, client run with Mono, server run
+with Mono would always work, but occasionally Mono-run server with .NET-run
+client would throw an exception. However HttpChannel-like behavior was
+never exhibited.