[Mono-dev] Patch for System.Runtime.Remoting: remove application name while extracting object uri from url

Robert Jordan robertj at gmx.net
Sun Oct 30 17:48:34 EST 2005


Hi Svetlana,

> In .NET the url to the remote object can contain the application name.
> In the IIS hosted applications it is mandatory.
> This application name should be removed during parsing of the url to
> extract object uri.
> I prepared patch to handle urls which contain application name.


I cannot reproduce that parsing behavior on .NET. If you run
the following test on .NET, you'll see that the application
name doesn't get removed from the channel url.

The problem with mono's channels & IIS must be somewhere else.
Since only HttpChannel can be hosted, the problem might
be in System.Runtime.Remoting.Channels.Http.HttpRemotingHandler.

Robert

using System;
using System.Reflection;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Remoting.Channels.Http;

class Test
{
     static void Main ()
     {
         RemotingConfiguration.ApplicationName = "foo";
         TcpChannel tc = new TcpChannel (0);
         HttpChannel hc = new HttpChannel (0);

         TestParse (tc, "tcp://localhost:1234/foo/object.rem");
         TestParse (tc, "tcp://localhost:1234/object.rem");
         TestParse (tc, "tcp://localhost:1234/foo/");
         TestParse (tc, "tcp://localhost:1234/foo");
         TestParse (tc, "tcp://localhost:1234");

         TestParse (hc, "http://localhost:1234/foo/object.rem");
         TestParse (hc, "http://localhost:1234/object.rem");
         TestParse (hc, "http://localhost:1234/foo/");
         TestParse (hc, "http://localhost:1234/foo");
         TestParse (hc, "http://localhost:1234");
     }

     static void TestParse (IChannel chan, string url)
     {
         string objectUri;
         string channelUrl = chan.Parse (url, out objectUri);
         if (channelUrl != null)
             Console.WriteLine ("{0} {1}", channelUrl,
                                objectUri == null ? "null" : objectUri);
     }
}




More information about the Mono-devel-list mailing list