System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel Method

Registers a channel with the channel services.

Syntax

public static void RegisterChannel (IChannel chnl, bool ensureSecurity)

Parameters

chnl
The channel to register.
ensureSecurity
true ensures that security is enabled; otherwise false. Setting the value to false does not effect the security setting on the TCP or IPC channel.

Remarks

The ChannelServices.RegisterChannel(IChannel, bool) method receives the System.Runtime.Remoting.Channels.IChannel interface from a channel object. The channel's IChannel.ChannelName must be unique, or the channel must be anonymous. A channel is anonymous if the IChannel.ChannelName is set to either null or string.Empty by using the name configuration property.

You cannot register two channels with the same name in a AppDomain. By default, the name of a System.Runtime.Remoting.Channels.Http.HttpChannel is "http" and the name of a System.Runtime.Remoting.Channels.Tcp.TcpChannel is "tcp". Therefore, if you want to register two channels of the same type, you must specify a different name for one of them through configuration properties.

For more information about channel configuration properties, see Channel and Formatter Configuration Properties and [<topic://gnconchanneltemplate>].

If the ensureSecurity parameter is set to true, the remoting system determines whether the channel implements System.Runtime.Remoting.Channels.ISecurableChannel, and if so, enables encryption and digital signatures. An exception is thrown if the channel does not implement System.Runtime.Remoting.Channels.ISecurableChannel.

Note:

Setting ensureSecurity to true throws a System.Runtime.Remoting.RemotingException for the System.Runtime.Remoting.Channels.Tcp.TcpServerChannel on Windows 98 (Since secure tcp channels are not supported on Windows 9x), and for the System.Runtime.Remoting.Channels.Http.HttpServerChannel on all platforms (You must host your service in IIS if you want to use a secure http channel).

Requirements

Namespace: System.Runtime.Remoting.Channels
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0