This documentation is archived and is not being maintained.

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)

'Declaration
<ComVisibleAttribute(True)> _
Public Interface IChannelReceiverHook
'Usage
Dim instance As IChannelReceiverHook

' Implementation of 'IChannelReceiverHook' interface.
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _
Public Class MyCustomChannel
   Implements IChannelReceiverHook 
   Private portSet As Boolean 

   ' Constructor for MyCustomChannel. 
   Public Sub New(ByVal port As Integer)
      portSet = True 
   End Sub 'New 

   ' Constructor for MyCustomChannel. 
   Public Sub New()
      portSet = False 
   End Sub 'New 

   Public ReadOnly Property WantsToListen() As Boolean Implements IChannelReceiverHook.WantsToListen
      Get 
         If portSet Then 
            Return False 
         Else 
            Return True 
         End If 
      End Get 
   End Property 

   Private MyChannelScheme As String = "http" 

   Public ReadOnly Property ChannelScheme() As String Implements IChannelReceiverHook.ChannelScheme
      Get 
         Return MyChannelScheme
      End Get 
   End Property 

   Public ReadOnly Property ChannelSinkChain() As IServerChannelSink _
                                       Implements IChannelReceiverHook.ChannelSinkChain
      Get 
         ' Null implementation. 
         Return Nothing 
      End Get 
   End Property 

   Public Sub AddHookChannelUri(ByVal channelUri As String) _
                                          Implements IChannelReceiverHook.AddHookChannelUri
      ' Null implementation. 
   End Sub 'AddHookChannelUri
End Class 'MyCustomChannel 
// Implementation of 'IChannelReceiverHook' interface.
public __gc class MyCustomChannel : public IChannelReceiverHook 
{
private:
   bool portSet;
   // Constructor for MyCustomChannel.
public:
   MyCustomChannel(int /*port*/)
   {
      MyChannelScheme = S"http";
      portSet = true;
   }
   // Constructor for MyCustomChannel.
   MyCustomChannel()
   {
      MyChannelScheme = S"http";
      portSet = false;
   }
public:
   __property bool get_WantsToListen()
   {
      if (portSet)
      {
         return false;
      }
      else
      {
         return true;
      }
   }

private:
   String* MyChannelScheme;
public:
   __property String* get_ChannelScheme()
   {
      return MyChannelScheme;
   }

   __property IServerChannelSink* get_ChannelSinkChain()
   {
      // Null implementation.
      return 0;
   }

   void AddHookChannelUri(String* /*channelUri*/)
   {
      // Null implementation.
   }
};

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

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: