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


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

IpcServerChannel クラスの使用方法を次のコード例に示します。
using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Ipc; public class IpcServer { public static void Main () { // Create and register an IPC channel IpcServerChannel serverChannel = new IpcServerChannel("remote"); ChannelServices.RegisterChannel(serverChannel); // Expose an object RemotingConfiguration.RegisterWellKnownServiceType( typeof(Counter), "counter", WellKnownObjectMode.Singleton ); // Wait for calls Console.WriteLine("Listening on {0}", serverChannel.GetChannelUri()); Console.ReadLine(); } }
#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 IpcServer { public: void IpcServerTest() { // Create and register an IPC channel IpcServerChannel^ serverChannel = gcnew IpcServerChannel( L"remote" ); ChannelServices::RegisterChannel( serverChannel ); // Expose an object RemotingConfiguration::RegisterWellKnownServiceType( Counter::typeid, L"counter", WellKnownObjectMode::Singleton ); // Wait for calls Console::WriteLine( L"Listening on {0}", serverChannel->GetChannelUri() ); Console::ReadLine(); } }; int main() { IpcServer^ is = gcnew IpcServer; is->IpcServerTest(); }
import System.*; import System.Runtime.Remoting.*; import System.Runtime.Remoting.Channels.*; import System.Runtime.Remoting.Channels.Ipc.*; public class IpcServer { public static void main(String[] args) { // Create and register an IPC channel IpcServerChannel serverChannel = new IpcServerChannel("remote"); ChannelServices.RegisterChannel(serverChannel); // Expose an object RemotingConfiguration.RegisterWellKnownServiceType( Counter.class.ToType(), "counter", WellKnownObjectMode.Singleton); // Wait for calls Console.WriteLine("Listening on {0}", serverChannel.GetChannelUri()); Console.ReadLine(); } //main } //IpcServer
上記のコードは、次のリモート オブジェクトを公開するために使用されます。
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
このオブジェクトをリモートで使用するクライアントの例については、IpcClientChannel のドキュメントを参照してください。

System.Runtime.Remoting.Channels.Ipc.IpcServerChannel


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IpcServerChannel コンストラクタ (IDictionary, IServerChannelSinkProvider)
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)

Public Sub New ( _ properties As IDictionary, _ sinkProvider As IServerChannelSinkProvider _ )
Dim properties As IDictionary Dim sinkProvider As IServerChannelSinkProvider Dim instance As New IpcServerChannel(properties, sinkProvider)
public IpcServerChannel ( IDictionary properties, IServerChannelSinkProvider sinkProvider )
public: IpcServerChannel ( IDictionary^ properties, IServerChannelSinkProvider^ sinkProvider )
public IpcServerChannel ( IDictionary properties, IServerChannelSinkProvider sinkProvider )
public function IpcServerChannel ( properties : IDictionary, sinkProvider : IServerChannelSinkProvider )

チャネル構成プロパティの詳細については、「チャネルおよびフォーマッタの構成プロパティ」を参照してください。
シンク機能が不要な場合は、sinkProvider パラメータを null 参照 (Visual Basic では Nothing) に設定します。

// Create the server channel. System.Collections.IDictionary properties = new System.Collections.Hashtable(); properties["name"] = "ipc"; properties["priority"] = "20"; properties["portName"] = "localhost:9090"; IpcServerChannel serverChannel = new IpcServerChannel(properties, null);
// Create the server channel. System::Collections::IDictionary^ properties = gcnew System::Collections::Hashtable; properties->default[ L"name" ] = L"ipc"; properties->default[ L"priority" ] = L"20"; properties->default[ L"portName" ] = L"localhost:9090"; IpcServerChannel^ serverChannel = gcnew IpcServerChannel( properties, nullptr );


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IpcServerChannel コンストラクタ (IDictionary, IServerChannelSinkProvider, CommonSecurityDescriptor)
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)

Public Sub New ( _ properties As IDictionary, _ sinkProvider As IServerChannelSinkProvider, _ securityDescriptor As CommonSecurityDescriptor _ )
Dim properties As IDictionary Dim sinkProvider As IServerChannelSinkProvider Dim securityDescriptor As CommonSecurityDescriptor Dim instance As New IpcServerChannel(properties, sinkProvider, securityDescriptor)
public IpcServerChannel ( IDictionary properties, IServerChannelSinkProvider sinkProvider, CommonSecurityDescriptor securityDescriptor )
public: IpcServerChannel ( IDictionary^ properties, IServerChannelSinkProvider^ sinkProvider, CommonSecurityDescriptor^ securityDescriptor )
public IpcServerChannel ( IDictionary properties, IServerChannelSinkProvider sinkProvider, CommonSecurityDescriptor securityDescriptor )
public function IpcServerChannel ( properties : IDictionary, sinkProvider : IServerChannelSinkProvider, securityDescriptor : CommonSecurityDescriptor )

チャネル構成プロパティの詳細については、「チャネルおよびフォーマッタの構成プロパティ」を参照してください。
シンク機能が不要な場合は、sinkProvider パラメータを null 参照 (Visual Basic では Nothing) に設定します。セキュリティ記述子が不要な場合は、securityDescriptor パラメータを null 参照 (Visual Basic では Nothing) に設定します。


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IpcServerChannel コンストラクタ

名前 | 説明 |
---|---|
IpcServerChannel (String) | IPC ポート名を指定して IpcServerChannel クラスの新しいインスタンスを初期化します。 |
IpcServerChannel (IDictionary, IServerChannelSinkProvider) | チャネル プロパティとシンクを指定して、IpcServerChannel クラスの新しいインスタンスを初期化します。 |
IpcServerChannel (String, String) | チャネル名と IPC ポート名を指定して、IpcServerChannel クラスの新しいインスタンスを初期化します。 |
IpcServerChannel (IDictionary, IServerChannelSinkProvider, CommonSecurityDescriptor) | チャネル プロパティ、シンク、およびセキュリティ記述子を指定して、IpcServerChannel クラスの新しいインスタンスを初期化します。 |
IpcServerChannel (String, String, IServerChannelSinkProvider) | チャネル名、IPC ポート名、およびシンクを指定して、IpcServerChannel クラスの新しいインスタンスを初期化します。 |

IpcServerChannel コンストラクタ (String, String, IServerChannelSinkProvider)
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)

Public Sub New ( _ name As String, _ portName As String, _ sinkProvider As IServerChannelSinkProvider _ )
Dim name As String Dim portName As String Dim sinkProvider As IServerChannelSinkProvider Dim instance As New IpcServerChannel(name, portName, sinkProvider)
public: IpcServerChannel ( String^ name, String^ portName, IServerChannelSinkProvider^ sinkProvider )
public function IpcServerChannel ( name : String, portName : String, sinkProvider : IServerChannelSinkProvider )

このコンストラクタは、name パラメータを使用して ChannelName プロパティを設定します。複数のチャネルを登録する場合は、各チャネルに一意の名前を付ける必要があります。
シンク機能が不要な場合は、sinkProvider パラメータを null 参照 (Visual Basic では Nothing) に設定します。



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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IpcServerChannel コンストラクタ (String)
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)


// Create and register an IPC channel IpcServerChannel serverChannel = new IpcServerChannel("remote"); ChannelServices.RegisterChannel(serverChannel);


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IpcServerChannel コンストラクタ (String, String)
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)





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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IpcServerChannel プロパティ

名前 | 説明 | |
---|---|---|
![]() | ChannelData | チャネル固有のデータを取得します。 |
![]() | ChannelName | 現在のチャネルの名前を取得します。 |
![]() | ChannelPriority | 現在のチャネルの優先順位を取得します。 |
![]() | IsSecured |

IpcServerChannel メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetChannelUri | 現在のチャネルの URI を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | GetUrlsForUri | 指定した URI を持つオブジェクトのすべての URL のうち、現在の IpcChannel インスタンスでホストされている URL の配列を返します。 |
![]() | Parse | 指定した URL からチャネル URI と既知のリモート オブジェクト URI を抽出します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | StartListening | 現在のチャネルに対して、要求の待機を開始するように指示します。 |
![]() | StopListening | 現在のチャネルに対して、要求の待機を停止するように指示します。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

IpcServerChannel メンバ
IPC システムを使用してメッセージを送信するリモート呼び出しのサーバー チャネルを実装します。
IpcServerChannel データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | ChannelData | チャネル固有のデータを取得します。 |
![]() | ChannelName | 現在のチャネルの名前を取得します。 |
![]() | ChannelPriority | 現在のチャネルの優先順位を取得します。 |
![]() | IsSecured |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetChannelUri | 現在のチャネルの URI を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | GetUrlsForUri | 指定した URI を持つオブジェクトのすべての URL のうち、現在の IpcChannel インスタンスでホストされている URL の配列を返します。 |
![]() | Parse | 指定した URL からチャネル URI と既知のリモート オブジェクト URI を抽出します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | StartListening | 現在のチャネルに対して、要求の待機を開始するように指示します。 |
![]() | StopListening | 現在のチャネルに対して、要求の待機を停止するように指示します。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- IpcServerChannelのページへのリンク