ChannelServices.RegisterChannel メソッド

定義

オーバーロード

RegisterChannel(IChannel)
古い.

チャネル サービスを備えたチャネルを登録します。 RegisterChannel(IChannel) は互換性のために残されています。 代わりに、RegisterChannel(IChannel, Boolean) を使用してください。

RegisterChannel(IChannel, Boolean)

チャネル サービスを備えたチャネルを登録します。

RegisterChannel(IChannel)

注意事項

Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.

チャネル サービスを備えたチャネルを登録します。 RegisterChannel(IChannel) は互換性のために残されています。 代わりに、RegisterChannel(IChannel, Boolean) を使用してください。

public:
 static void RegisterChannel(System::Runtime::Remoting::Channels::IChannel ^ chnl);
public static void RegisterChannel (System.Runtime.Remoting.Channels.IChannel chnl);
[System.Obsolete("Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.", false)]
public static void RegisterChannel (System.Runtime.Remoting.Channels.IChannel chnl);
static member RegisterChannel : System.Runtime.Remoting.Channels.IChannel -> unit
[<System.Obsolete("Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.", false)>]
static member RegisterChannel : System.Runtime.Remoting.Channels.IChannel -> unit
Public Shared Sub RegisterChannel (chnl As IChannel)

パラメーター

chnl
IChannel

登録するチャネル。

属性

例外

chnl パラメーターが null です。

チャネルが既に登録されています。

コールスタックの上位にある 1 つ以上の呼び出し元に、リモート処理の型とチャネルを構成するためのアクセス許可がありません。

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();
HttpChannel channel = new HttpChannel(9000);
ChannelServices.RegisterChannel(channel);

RemotingConfiguration.RegisterWellKnownServiceType( typeof(SampleService),
"MySampleService/SampleService.soap", WellKnownObjectMode.Singleton);

Console.WriteLine("** Press enter to end the server process. **");
Console.ReadLine();
Dim channel As New HttpChannel(9000)
ChannelServices.RegisterChannel(channel)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(SampleService), "MySampleService/SampleService.soap", WellKnownObjectMode.Singleton)

Console.WriteLine("** Press enter to end the server process. **")
Console.ReadLine()

注釈

Note

RegisterChannel(IChannel) は互換性のために残されています。 代わりに、RegisterChannel(IChannel, Boolean) を使用してください。

メソッドは RegisterChannel 、チャネル オブジェクトから インターフェイスを受け取ります IChannel 。 チャネルは ChannelName 一意であるか、チャネルが匿名である必要があります。 が または 構成プロパティを使用nameしてにEmptynull設定されている場合IChannel.ChannelName、チャネルは匿名です。

に同じ名前の 2 つのチャネルを AppDomain登録することはできません。 既定では、 の HttpChannel 名前は "http" で、 の TcpChannel 名前は "tcp" です。したがって、同じ種類の 2 つのチャネルを登録する場合は、構成プロパティを使用して、そのうちの 1 つに別の名前を指定する必要があります。

チャネル構成プロパティの詳細については、「、および <channel> 要素 (テンプレート)」を参照してくださいHttpChannel

適用対象

RegisterChannel(IChannel, Boolean)

チャネル サービスを備えたチャネルを登録します。

public:
 static void RegisterChannel(System::Runtime::Remoting::Channels::IChannel ^ chnl, bool ensureSecurity);
public static void RegisterChannel (System.Runtime.Remoting.Channels.IChannel chnl, bool ensureSecurity);
static member RegisterChannel : System.Runtime.Remoting.Channels.IChannel * bool -> unit
Public Shared Sub RegisterChannel (chnl As IChannel, ensureSecurity As Boolean)

パラメーター

chnl
IChannel

登録するチャネル。

ensureSecurity
Boolean

セキュリティを有効にする場合は true。それ以外の場合は false。 この値を false に設定しても、TCP チャネルまたは IPC チャネルのセキュリティ設定には影響しません。

例外

chnl パラメーターが null です。

チャネルが既に登録されています。

コールスタックの上位にある 1 つ以上の呼び出し元に、リモート処理の型とチャネルを構成するためのアクセス許可がありません。

HttpServerChannel ではサポートされていません。 セキュリティ保護された HTTP チャネルが必要な場合は、インターネット インフォメーション サービス (IIS) を使ってサービスをホストしてください。

注釈

メソッドは RegisterChannel(IChannel, Boolean)IChannel チャネル オブジェクトからインターフェイスを受け取ります。 チャネルは ChannelName 一意であるか、チャネルが匿名である必要があります。 が または 構成プロパティを使用nameしてにEmptynull設定されている場合IChannel.ChannelName、チャネルは匿名です。

に同じ名前の 2 つのチャネルを AppDomain登録することはできません。 既定では、 の HttpChannel 名前は "http" で、 の TcpChannel 名前は "tcp" です。 したがって、同じ種類の 2 つのチャネルを登録する場合は、構成プロパティを使用して、そのうちの 1 つに別の名前を指定する必要があります。

チャネル構成プロパティの詳細については、「 Channel and Formatter Configuration Properties and <channel> Element (Template)」を参照してください。

パラメーターが ensureSecuritytrue設定されている場合、リモート処理システムはチャネルが を実装 ISecurableChannelしているかどうかを判断し、実装されている場合は暗号化とデジタル署名を有効にします。 チャネルが を実装 ISecurableChannelしていない場合、例外がスローされます。

Note

を に設定 ensureSecurity すると trueRemotingException すべてのプラットフォームでチャネルの HttpServerChannel がスローされます。 セキュリティで保護された http チャネルを使用する場合は、IIS でサービスをホストする必要があります。

適用対象