ChannelServices.UnregisterChannel Method (IChannel)

 

Unregisters a particular channel from the registered channels list.

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

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.RemotingConfiguration)]
public 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: