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 class IChannelReceiverHook

NameDescription
System_CAPS_pubpropertyChannelScheme

Gets the type of listener to hook into.

System_CAPS_pubpropertyChannelSinkChain

Gets the channel sink chain that the current channel is using.

System_CAPS_pubpropertyWantsToListen

Gets a Boolean value that indicates whether IChannelReceiverHook needs to be hooked into the outside listener service.

NameDescription
System_CAPS_pubmethodAddHookChannelUri(String^)

Adds a URI on which the channel hook will listen.

// Implementation of 'IChannelReceiverHook' interface.
public ref class MyCustomChannel: public IChannelReceiverHook
{
private:
   bool portSet;

public:
   // Constructor for MyCustomChannel.
   MyCustomChannel( int /*port*/ )
   {
      MyChannelScheme = "http";
      portSet = true;
   }

   // Constructor for MyCustomChannel.
   MyCustomChannel()
   {
      MyChannelScheme = "http";
      portSet = false;
   }

   property bool WantsToListen 
   {
      [System::Security::Permissions::SecurityPermissionAttribute
      (System::Security::Permissions::SecurityAction::LinkDemand,
      Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
      virtual bool get()
      {
         if ( portSet )
         {
            return false;
         }
         else
         {
            return true;
         }
      }
   }

private:
   String^ MyChannelScheme;

public:
   property String^ ChannelScheme 
   {
      [System::Security::Permissions::SecurityPermissionAttribute
      (System::Security::Permissions::SecurityAction::LinkDemand,
      Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
      virtual String^ get()
      {
         return MyChannelScheme;
      }
   }

   property IServerChannelSink^ ChannelSinkChain 
   {
      [System::Security::Permissions::SecurityPermissionAttribute
      (System::Security::Permissions::SecurityAction::LinkDemand,
      Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
      virtual IServerChannelSink^ get()
      {

         // Null implementation.
         return nullptr;
      }
   }

   [System::Security::Permissions::SecurityPermissionAttribute
   (System::Security::Permissions::SecurityAction::LinkDemand,
   Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
   virtual void AddHookChannelUri( String^ /*channelUri*/ )
   {
      // Null implementation.
   }
};

.NET Framework
Available since 1.1
Return to top
Show: