Click here to Skip to main content
12,356,678 members (64,663 online)
Click here to Skip to main content

Stats

22.7K views
516 downloads
30 bookmarked
Posted

Remoting Compression Channel Sink

, 12 Nov 2008 CPOL
An article explaining a Remoting extensible channel sink architecture and an implementation of the compression channel sink.
using System;
using System.Runtime.Remoting.Channels.Http;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting;
using Business;
using Model;

namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
            RemotingConfiguration.Configure(@"..\..\client.config", false);

            foreach (HttpChannel channel in ChannelServices.RegisteredChannels)
            {
                Console.WriteLine("Channel Name: {0}", channel.ChannelName);
                Console.WriteLine("Channel Priority: {0}", channel.ChannelPriority);
            }
            
            string objectUrl = string.Empty;
            foreach (WellKnownClientTypeEntry entry in RemotingConfiguration.GetRegisteredWellKnownClientTypes())
            {
                if (entry.ObjectType == typeof(BusinessManager))
                    objectUrl = entry.ObjectUrl;
            }

            BusinessManager manager = (BusinessManager)Activator.GetObject(typeof(BusinessManager), objectUrl);
            ConcreteTypeRequest request = new ConcreteTypeRequest();
            request.Data = new ConcreteType();
            request.Data.Value = new byte[500000];
            ConcreteTypeResponse response = manager.DoBusinessOperation(request);
            Console.WriteLine("The request data length: {0}", request.Data.Value.GetLength(0));
            Console.WriteLine("The response data length: {0}", response.Data.Value.GetLength(0));
            
            Console.WriteLine("Press ENTER to exit the client.");
            Console.ReadLine();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

aschmidt
United States United States
Alexander Schmidt. I'm a software developer, who is working primarily with Microsoft technologies including Microsoft .NET. I'm also interested in optimization problems and software engineering in general. You can visit my blog at http://www.alexschmidt.net

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160621.1 | Last Updated 13 Nov 2008
Article Copyright 2008 by aschmidt
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid