2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Channels / CrossAppDomainChannel.cs
index b66ebb1c29dc1e111d7fe4f56fddacedfd06b590..836ce0f8c2af5358688dcfe3eae7f78b9fff120f 100755 (executable)
@@ -125,28 +125,19 @@ namespace System.Runtime.Remoting.Channels
                public virtual IMessageSink CreateMessageSink(String url, Object data, out String uri) \r
                {\r
                        uri = null;\r
-                       IMessageSink sink = null;\r
             \r
-                       if (url == null && data != null) \r
+                       if (data != null) \r
                        {\r
                                // Get the data and then get the sink\r
                                CrossAppDomainData cadData = data as CrossAppDomainData;\r
                                if (cadData != null && cadData.ProcessID == RemotingConfiguration.ProcessId)\r
                                        // GetSink creates a new sink if we don't have any (use contexts here later)\r
-                                       sink = CrossAppDomainSink.GetSink(cadData.DomainID);\r
+                                       return CrossAppDomainSink.GetSink(cadData.DomainID);\r
                        } \r
-                       else \r
-                       {\r
-                               if (url != null && data == null) \r
-                               {\r
-                                       if (url.StartsWith(_strName)) \r
-                                       {\r
-                                               throw new NotSupportedException("Can't create a named channel via crossappdomain");\r
-                                       }\r
-                               }\r
-                       }\r
+                       if (url != null && url.StartsWith(_strName)) \r
+                               throw new NotSupportedException("Can't create a named channel via crossappdomain");\r
 \r
-                       return sink;\r
+                       return null;\r
                }
        }
        \r
@@ -182,6 +173,10 @@ namespace System.Runtime.Remoting.Channels
                                        return sink;\r
                                }\r
                        }\r
+               }\r
+               \r
+               internal int TargetDomainId {\r
+                       get { return _domainID; }\r
                }
 
                private struct ProcessMessageRes {