IpcClientChannel クラス
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)


チャネルは、リモート呼び出しを転送するために .NET Framework のリモート処理インフラストラクチャによって使用されます。クライアントがリモート オブジェクトを呼び出すと、この呼び出しは、クライアント チャネルからサーバー チャネルに送信されるメッセージとしてシリアル化されます。メッセージの受信後、このメッセージが逆シリアル化され、処理されます。戻り値は、サーバー チャネルからクライアント チャネルに送信されます。
IpcClientChannel クラスは、Windows のプロセス間通信 (IPC) システムを使用して、同じコンピュータ上のアプリケーション ドメイン間でメッセージを転送します。同じコンピュータ上のアプリケーション ドメイン間で通信する場合、IPC チャネルは TCP チャネルや HTTP チャネルよりもはるかに高速です。
クライアント側でメッセージの追加的な処理を実行するには、IpcClientChannel オブジェクトによって処理されるすべてのメッセージが通過する IClientChannelSinkProvider インターフェイスの実装を指定します。
既定では、IpcClientChannel クラスはバイナリ フォーマッタを使用してすべてのメッセージをシリアル化します。
IpcClientChannel オブジェクトには、構成ファイルを使用して (静的 RemotingConfiguration.Configure メソッドを呼び出す)、またはプログラムで (IpcClientChannel コンストラクタに IDictionary コレクションを渡す)、実行時に設定できる構成プロパティが関連付けられています。これらの構成プロパティの一覧については、IpcClientChannel コンストラクタのトピックを参照してください。

IpcClientChannel クラスを使用するコード例を次に示します。
using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Ipc; public class Client { public static void Main () { IpcClientChannel clientChannel = new IpcClientChannel(); ChannelServices.RegisterChannel(clientChannel); RemotingConfiguration.RegisterWellKnownClientType( typeof(Counter) , "ipc://remote/counter" ); Counter counter = new Counter(); Console.WriteLine("This is call number {0}.", counter.Count); } }
#using <System.Runtime.Remoting.dll> #using <System.dll> #using <Counter.dll> using namespace System; using namespace System::Runtime::Remoting; using namespace System::Runtime::Remoting::Channels; using namespace System::Runtime::Remoting::Channels::Ipc; public ref class Client { public: void ClientTest() { IpcClientChannel^ clientChannel = gcnew IpcClientChannel; ChannelServices::RegisterChannel( clientChannel ); RemotingConfiguration::RegisterWellKnownClientType( Counter::typeid, L"ipc://remote/counter" ); Counter^ counter = gcnew Counter; Console::WriteLine( L"This is call number {0}.", counter->Count ); } }; int main() { Client^ c = gcnew Client; c->ClientTest(); }
import System.*; import System.Runtime.Remoting.*; import System.Runtime.Remoting.Channels.*; import System.Runtime.Remoting.Channels.Ipc.*; public class Client { public static void main(String[] args) { IpcClientChannel clientChannel = new IpcClientChannel(); ChannelServices.RegisterChannel(clientChannel); RemotingConfiguration.RegisterWellKnownClientType( Counter.class.ToType(), "ipc://remote/counter"); Counter counter = new Counter(); Console.WriteLine("This is call number {0}.", System.Convert.ToString(counter.get_Count())); } //main } //Client
上記のコードでは、次のリモート オブジェクトを使用しています。
using System; public class Counter : MarshalByRefObject { private int count = 0; public int Count { get { return(count++); } } }
using namespace System; public ref class Counter: public MarshalByRefObject { private: int count; public: Counter() { count = 0; } property int Count { int get() { return (count)++; } } };
import System.*; public class Counter extends MarshalByRefObject { private int count = 0; /** @property */ public int get_Count() { return count++; } //get_Count } //Counter
このオブジェクトをリモートで公開するサーバーの例については、IpcServerChannel のトピックを参照してください。

System.Runtime.Remoting.Channels.Ipc.IpcClientChannel


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- IpcClientChannel クラスのページへのリンク