This documentation is archived and is not being maintained.
IChannelReceiverHook Interface
.NET Framework 1.1
Indicates that the implementing channel wants to hook into the outside listener service.
For a list of all members of this type, see IChannelReceiverHook Members.
[Visual Basic] Public Interface IChannelReceiverHook [C#] public interface IChannelReceiverHook [C++] public __gc __interface IChannelReceiverHook [JScript] public interface IChannelReceiverHook
Classes that Implement IChannelReceiverHook
| Class | Description |
|---|---|
| HttpChannel | Provides an implementation for a sender-receiver channel that uses the HTTP protocol to transmit messages. |
| HttpServerChannel | Provides an implementation for a server channel that uses the HTTP protocol to transmit messages. |
Example
[Visual Basic] ' Implementation of 'IChannelReceiverHook' interface. 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 [C#] // Implementation of 'IChannelReceiverHook' interface. 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. } } [C++] // 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. } };
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Namespace: System.Runtime.Remoting.Channels
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: Mscorlib (in Mscorlib.dll)
See Also
IChannelReceiverHook Members | System.Runtime.Remoting.Channels Namespace
Show: