Export (0) Print
Expand All

IChannelReceiverHook Interface

Indicates that the implementing channel wants to hook into the outside listener service.

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

[ComVisibleAttribute(true)] 
public interface IChannelReceiverHook
/** @attribute ComVisibleAttribute(true) */ 
public interface IChannelReceiverHook
ComVisibleAttribute(true) 
public interface IChannelReceiverHook

// Implementation of 'IChannelReceiverHook' interface.
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class MyCustomChannel : IChannelReceiverHook 
{
   private bool portSet;
   // Constructor for MyCustomChannel.
   public MyCustomChannel(int port)
   {
      portSet = true;
   }
   // Constructor for MyCustomChannel.
   public MyCustomChannel()
   {
      portSet = false;
   }
   public bool WantsToListen
   {
      get
      {
         if (portSet)
         {
            return false;
         }
         else
         {
            return true;
         }
      }
   }
   private string MyChannelScheme = "http";
   public string ChannelScheme
   {
      get
      {
         return MyChannelScheme;
      }
   }
   public IServerChannelSink ChannelSinkChain
   {
      get
      {
         // Null implementation.
         return null;
      }
   }
   public void AddHookChannelUri(string channelUri)
   {
      // Null implementation.
   }
}

// Implementation of 'IChannelReceiverHook' interface.
/** @attribute SecurityPermission(SecurityAction.Demand,
                    Flags = SecurityPermissionFlag.Infrastructure)
 */
/** @attribute SecurityPermission(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.Infrastructure)
 */
public class MyCustomChannel implements IChannelReceiverHook
{
    private boolean portSet;

    // Constructor for MyCustomChannel.
    public MyCustomChannel(int port) 
    {
        portSet = true;
    } //MyCustomChannel

    // Constructor for MyCustomChannel.
    public MyCustomChannel()
    {
        portSet = false;
    } //MyCustomChannel

    /** @property 
     */
    public boolean get_WantsToListen()
    {
        if (portSet) {
            return false;
        }
        else {
            return true;
        }
    } //get_WantsToListen

    private String myChannelScheme = "http";

    /** @property 
     */
    public String get_ChannelScheme()
    {
        return myChannelScheme;
    } //get_ChannelScheme

    /** @property 
     */
    public IServerChannelSink get_ChannelSinkChain()
    {
        // Null implementation.
        return null;
    } //get_ChannelSinkChain

    public void AddHookChannelUri(String channelUri)
    {
        // Null implementation.
    } //AddHookChannelUri
} //MyCustomChannel 

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

ADD
Show:
© 2014 Microsoft