IChannelSender Interface

Provides required functions and properties for the sender channels.

Namespace: System.Runtime.Remoting.Channels
Assembly: mscorlib (in mscorlib.dll)

public interface IChannelSender : IChannel
/** @attribute ComVisibleAttribute(true) */ 
public interface IChannelSender extends IChannel
public interface IChannelSender extends IChannel

The sending side of channels must expose the IChannelSender interface.

using System;
using System.Collections;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Channels.Http;
using System.Security.Permissions;

public class MyClient
   public static void Main()
         // Create the 'IDictionary' to set the server object properties.
         IDictionary myDictionary = new Hashtable();
         myDictionary["name"] = "HttpClientChannel";
         myDictionary["priority"] = 2;
         // Set the properties along with the constructor.
         IChannelSender myIChannelSender = new HttpClientChannel(myDictionary,
                                    new BinaryClientFormatterSinkProvider());
         // Register the server channel.
         MyHelloServer myHelloServer1 = (MyHelloServer)Activator.GetObject(
                  typeof(MyHelloServer), "http://localhost:8085/SayHello");
         if (myHelloServer1 == null)
            Console.WriteLine("Could not locate server");
            // Get the name of the channel.
            Console.WriteLine("Channel Name :" + myIChannelSender.ChannelName);
            // Get the channel priority.
            Console.WriteLine("ChannelPriority :" + 
            string myString,myObjectURI1;
            Console.WriteLine("Parse :" + 
                myIChannelSender.Parse("http://localhost:8085/SayHello",out myString)
                + myString);
            // Get the channel message sink that delivers message to specified url.
            IMessageSink myIMessageSink = 
                  "http://localhost:8085/NewEndPoint", null,out myObjectURI1);
            Console.WriteLine("Channel message sink used :" + myIMessageSink.ToString());
            Console.WriteLine("URI of new channel message sink :" + myObjectURI1);
      catch(Exception ex)
         Console.WriteLine("Following exception is raised on client side : " + ex.Message);

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions