[Mono-bugs] [Bug 58319][Nor] Changed - RemotingConfiguration incomplete?

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 11 May 2004 07:18:56 -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 jns@gellyfish.com.

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

--- shadow/58319	2004-05-11 07:13:37.000000000 -0400
+++ shadow/58319.tmp.17235	2004-05-11 07:18:56.000000000 -0400
@@ -1,19 +1,141 @@
 Bug#: 58319
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: Mandrake 9.2
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: jns@gellyfish.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: Remoting.Configuration incomplete?
+Summary: RemotingConfiguration incomplete?
+
+
+
+------- Additional Comments From jns@gellyfish.com  2004-05-11 07:18 -------
+There seems to be something missing in Remoting.Channels or
+Remoting.RemotingConfiguration -
+
+I am trying a test based in the example in MS SDK:
+
+Client:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+
+namespace RemotingTest
+{
+  public class Client
+  {
+    public static void Main(string [] args)
+    {
+      RemotingConfiguration.Configure("remoting.config");
+      HelloServer obj =
+(HelloServer)Activator.GetObject(typeof(RemotingTest.HelloServer),
+"http://localhost:8085/Hello");
+      if (obj == null)
+      {
+         System.Console.WriteLine("Could not locate server");
+      }
+      else
+      {
+         string name = "blah";
+         if ( args.Length > 0 )
+         {
+            name = args[0];
+         }
+         Console.WriteLine(obj.Hello(name));
+      }
+    }
+  }
+}
+
+
+Server:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+
+namespace RemotingTest
+{
+  public class Server
+  {
+
+    public static void Main(string [] args) {
+
+      HttpChannel chan = new HttpChannel(8085);
+      ChannelServices.RegisterChannel(chan);
+     
+RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType("RemotingTest.HelloServer,Object"),
+"Hello", WellKnownObjectMode.SingleCall);
+      System.Console.WriteLine("Hit <enter> to exit...");
+      System.Console.ReadLine();
+    }
+  }
+}
+
+Test Class:
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+using System.Reflection;
+
+namespace RemotingTest
+{
+  public class HelloServer : MarshalByRefObject
+  {
+
+    public HelloServer()
+    {
+      Console.WriteLine(this.ToString() + " activated");
+    }
+
+    public String Hello(String name)
+    {
+      Console.WriteLine("HelloServer.Hello : {0}", name);
+      return String.Format("Hi there {0}", name);
+    }
+  }
+}
+
+
+Firstly, unlike using the MS.NET SDK it will not work unless one loads
+the configuration like:
+
+<configuration>
+   <system.runtime.remoting>
+      <application>
+         <client>
+         </client>
+         <channels>
+            <channel
+               ref="http"
+               port="0"
+            />
+         </channels>
+      </application>
+   </system.runtime.remoting>
+</configuration>
+
+I was wondering why the difference in behaviour - does windows have the
+http channels already registered in some default configuration which
+mono doesn't have or is there a difference in behaviour of
+ChannelServices.RegisterChannel() in the mono library - I notice that
+the registered channels are stored in a static array in the
+ChannelServices class so it strikes me that another program is not going
+to have access to this - or am I missing something here?  However
+should RegisterWellKnownServiceType take care of this?