IChannel::ChannelName Property

 

Gets the name of the channel.

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

property String^ ChannelName {
	[SecurityCriticalAttribute]
	String^ get();
}

Property Value

Type: System::String^

The name of the channel.

Exception Condition
SecurityException

The immediate caller does not have infrastructure permission.

int myPort = 8085;

// Creating the 'IDictionary' to set the server object properties.
IDictionary^ myDictionary = gcnew Hashtable;
myDictionary[ "name" ] = "MyServerChannel1";
myDictionary[ "priority" ] = 2;
myDictionary[ "port" ] = 8085;

// Set the properties along with the constructor.
HttpServerChannel^ myHttpServerChannel = gcnew HttpServerChannel( myDictionary,gcnew BinaryServerFormatterSinkProvider );

// Register the server channel.
ChannelServices::RegisterChannel( myHttpServerChannel );
RemotingConfiguration::RegisterWellKnownServiceType( MyHelloServer::typeid, "SayHello", WellKnownObjectMode::SingleCall );
myHttpServerChannel->WantsToListen = true;

// Start listening on a specific port.
myHttpServerChannel->StartListening( myPort );

// Get the name of the channel.
Console::WriteLine( "ChannelName : {0}", myHttpServerChannel->ChannelName );

// Get the channel priority.
Console::WriteLine( "ChannelPriority : {0}", myHttpServerChannel->ChannelPriority );

// Get the schema of the channel.
Console::WriteLine( "ChannelScheme : {0}", myHttpServerChannel->ChannelScheme );

// Get the channel URI.
Console::WriteLine( "GetChannelUri : {0}", myHttpServerChannel->GetChannelUri() );

// Indicates whether 'IChannelReceiverHook' wants to be hooked into the outside listener service.
Console::WriteLine( "WantsToListen : {0}", myHttpServerChannel->WantsToListen );

SecurityPermission

for operating with infrastructure code. Demand value: SecurityAction::LinkDemand; Permission value: SecurityPermissionFlag::Infrastructure

.NET Framework
Available since 1.1
Return to top
Show: