public RemotingManagementSessionFactoryHost(string uri)
        {
            var parsedUri = new Uri(uri);

            if (parsedUri.Scheme != "tcp" || parsedUri.Host != "localhost" || parsedUri.Segments.Length != 2)
                throw new ArgumentException("uri");

            channel = new TcpServerChannel(parsedUri.Port);
            ChannelServices.RegisterChannel(channel, false);
            factory = new RemotingManagementSessionFactory();
            RemotingServices.Marshal(factory, parsedUri.Segments[1]);
        }
        public RemotingManagementSessionFactoryHost(string uri)
        {
            var parsedUri = new Uri(uri);

            if (parsedUri.Scheme != "tcp" || parsedUri.Host != "localhost" || parsedUri.Segments.Length != 2)
            {
                throw new ArgumentException("uri");
            }

            channel = new TcpServerChannel(parsedUri.Port);
            ChannelServices.RegisterChannel(channel, false);
            factory = new RemotingManagementSessionFactory();
            RemotingServices.Marshal(factory, parsedUri.Segments[1]);
        }