ChannelServices::RegisterChannel Method (IChannel^)
Registers a channel with the channel services. RegisterChannel(IChannel^) is obsolete. Please use RegisterChannel(IChannel^, Boolean) instead.
Assembly: mscorlib (in mscorlib.dll)
public: [ObsoleteAttribute("Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.", false)] [SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::RemotingConfiguration)] static void RegisterChannel( IChannel^ chnl )
Parameters
- chnl
-
Type:
System.Runtime.Remoting.Channels::IChannel^
The channel to register.
| Exception | Condition |
|---|---|
| ArgumentNullException | The chnl parameter is null. |
| RemotingException | The channel has already been registered. |
| SecurityException | At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. |
Note |
|---|
RegisterChannel(IChannel^) is obsolete. Please use RegisterChannel(IChannel^, Boolean) instead. |
The RegisterChannel method takes in the IChannel interface from a channel object. The channel's ChannelName must be unique, or the channel must be anonymous. A channel is anonymous if the IChannel::ChannelName is set to either null or 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 HttpChannel is "http" and the name of a 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 HttpChannel, and <channel> Element (Template).
HttpChannel^ channel = gcnew HttpChannel( 9000 ); ChannelServices::RegisterChannel( channel, false ); RemotingConfiguration::RegisterWellKnownServiceType( SampleNamespace::SampleService::typeid, "MySampleService/SampleService::soap", WellKnownObjectMode::Singleton ); Console::WriteLine( "** Press enter to end the server process. **" ); Console::ReadLine();
For configuration of the remoting infrastructure. Demand value: SecurityAction::Demand; Permission value: SecurityPermissionFlag::RemotingConfiguration
Available since 1.1
