[Mono-bugs] [Bug 62389][Nor] New - HttpServerChannel connects to 127.0.0.1 instead to NIC-address

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 3 Aug 2004 18:12:29 -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 pinguin04@bluewin.ch.

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

--- shadow/62389	2004-08-03 18:12:29.000000000 -0400
+++ shadow/62389.tmp.15574	2004-08-03 18:12:29.000000000 -0400
@@ -0,0 +1,88 @@
+Bug#: 62389
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: RedHat Linux 9
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: pinguin04@bluewin.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: HttpServerChannel connects to 127.0.0.1 instead to NIC-address
+
+1. execute "ifconfig" and notice output
+
+eth0: inet addr:192.168.23.2
+
+lo:   inet addr:127.0.0.1
+
+2. compile and run following C#-code:
+
+ IDictionary props = new Hashtable();
+ props["port"]="8088";
+ HttpServerChannel c = 
+   new HttpServerChannel(props,newSoapServerFormatterSinkProvider());
+
+ // print URI to which channel is connected to
+ Console.WriteLine(c.GetChannelUri());
+
+Actual Output:
+  http://127.0.0.1/8088
+
+Expected Output:
+  http://192.168.23.2/8088
+
+Expected Output is printed by Microsoft .NET Runtime V1.1
+on Windows 2000 SP4
+
+
+Further explanation
+===================
+
+HttpServerChannel should connect to the IP-Adress
+of NIC and not to localhost (127.0.0.1). This bug causes
+connecting to follwing remote-object to fail:
+
+ public Customer create() 
+ {
+  CustomerImpl ci = new CustomerImpl();
+  ObjRef or = RemotingServices.Marshal(ci);
+
+  return ci;
+ }
+
+(this remote-object is returned by another remote-object)
+
+It fails because mono publishes this object with the
+URL http://127.0.0.1/8088 and therefore cannot be reached
+from different machine.
+
+However as long as
+RemotingConfiguration.RegisterWellKnownServiceType is used,
+connecting to such objects works.
+
+
+Found Workaround
+================
+
+This code ensures, that HttpServerChannel
+is connected to 192.168.23.2:
+
+ IDictionary props = new Hashtable();
+ props["machineName"] = "192.168.23.2";
+ props["port"]="8088";
+ HttpServerChannel c = 
+   new HttpServerChannel(props,newSoapServerFormatterSinkProvider());
+
+
+But this code is not very useful, since you need to change
+the IP-Adress for every machine on which you want to run this.
+
+
+eMail me if need more information.