ChannelServices::UnregisterChannel Method (IChannel^)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Unregisters a particular channel from the registered channels list.

Namespace:   System.Runtime.Remoting.Channels
Assembly:  mscorlib (in mscorlib.dll)

public:
[SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::RemotingConfiguration)]
static void UnregisterChannel(
	IChannel^ chnl
)

Parameters

chnl
Type: System.Runtime.Remoting.Channels::IChannel^

The channel to unregister.

Exception Condition
ArgumentNullException

The chnl parameter is null.

ArgumentException

The channel is not registered.

SecurityException

At least one of the callers higher in the callstack does not have permission to configure remoting types and channels.

System::Console::WriteLine( "Hit <enter> to unregister the channels..." );
System::Console::ReadLine();

// Unregister the 'HttpChannel' and 'TcpChannel' channels.
ChannelServices::UnregisterChannel( myTcpChannel );
ChannelServices::UnregisterChannel( myHttpChannel );
Console::WriteLine( "Unregistered the channels." );

SecurityPermission

For configuration of the remoting infrastructure. Demand value: SecurityAction::Demand; Permission value: SecurityPermissionFlag::RemotingConfiguration

.NET Framework
Available since 1.1
Return to top
Show: