This documentation is archived and is not being maintained.

IChannel.ChannelName Property

Gets the name of the channel.

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

string ChannelName { get; }

Property Value

Type: System.String
The name of the channel.

ExceptionCondition
SecurityException

The immediate caller does not have infrastructure permission.

int myPort = 8085;
// Creating the 'IDictionary' to set the server object properties.
IDictionary myDictionary = new Hashtable();
myDictionary["name"] = "MyServerChannel1";
myDictionary["priority"] = 2;
myDictionary["port"] = 8085;
// Set the properties along with the constructor.
HttpServerChannel myHttpServerChannel = new HttpServerChannel(myDictionary,
                                    new BinaryServerFormatterSinkProvider());
// Register the server channel.
ChannelServices.RegisterChannel(myHttpServerChannel);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyHelloServer), 
                              "SayHello", WellKnownObjectMode.SingleCall);  
myHttpServerChannel.WantsToListen = true;
// Start listening on a specific port.
myHttpServerChannel.StartListening((object)myPort);
// Get the name of the channel.
Console.WriteLine("ChannelName : " + myHttpServerChannel.ChannelName);
// Get the channel priority.
Console.WriteLine("ChannelPriority : " + myHttpServerChannel.ChannelPriority);
// Get the schema of the channel.
Console.WriteLine("ChannelScheme : " + myHttpServerChannel.ChannelScheme);
// Get the channel URI.
Console.WriteLine("GetChannelUri : " + myHttpServerChannel.GetChannelUri());
// Indicates whether 'IChannelReceiverHook' wants to be hooked into the outside listener service.
Console.WriteLine("WantsToListen : " + myHttpServerChannel.WantsToListen);
int myPort = 8085;
// Creating the 'IDictionary' to set the server object properties.
IDictionary* myDictionary = new Hashtable();
myDictionary->Item[S"name"] = S"MyServerChannel1";
myDictionary->Item[S"priority"] = __box(2);
myDictionary->Item[S"port"] = __box(8085);
// Set the properties along with the constructor.
HttpServerChannel* myHttpServerChannel = new HttpServerChannel(myDictionary,
   new BinaryServerFormatterSinkProvider());
// Register the server channel.
ChannelServices::RegisterChannel(myHttpServerChannel);
RemotingConfiguration::RegisterWellKnownServiceType(__typeof(MyHelloServer), 
   S"SayHello", WellKnownObjectMode::SingleCall);  
myHttpServerChannel->WantsToListen = true;
// Start listening on a specific port.
myHttpServerChannel->StartListening(__box(myPort));
// Get the name of the channel.
Console::WriteLine(S"ChannelName : {0}", myHttpServerChannel->ChannelName);
// Get the channel priority.
Console::WriteLine(S"ChannelPriority : {0}", __box(myHttpServerChannel->ChannelPriority));
// Get the schema of the channel.
Console::WriteLine(S"ChannelScheme : {0}", myHttpServerChannel->ChannelScheme);
// Get the channel URI.
Console::WriteLine(S"GetChannelUri : {0}", myHttpServerChannel->GetChannelUri());
// Indicates whether 'IChannelReceiverHook' wants to be hooked into the outside listener service.
Console::WriteLine(S"WantsToListen : {0}", __box(myHttpServerChannel->WantsToListen));

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: