IpcServerChannel 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 IpcServerChannel 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| IpcServerChannel(String) |
初始化一個新的類別實例 IpcServerChannel ,並以指定的 IPC 埠名稱。 |
| IpcServerChannel(IDictionary, IServerChannelSinkProvider) |
初始化一個具有指定通道屬性與 sink 的類別新實例 IpcServerChannel 。 |
| IpcServerChannel(String, String) |
初始化一個新的類別實例 IpcServerChannel ,使用指定的通道名稱與 IPC 埠名。 |
| IpcServerChannel(IDictionary, IServerChannelSinkProvider, CommonSecurityDescriptor) |
初始化一個具備指定通道特性、sink 及安全描述符的新類別實例 IpcServerChannel 。 |
| IpcServerChannel(String, String, IServerChannelSinkProvider) |
初始化一個新的類別實例 IpcServerChannel ,使用指定的通道名稱、IPC 埠名和 sink。 |
IpcServerChannel(String)
初始化一個新的類別實例 IpcServerChannel ,並以指定的 IPC 埠名稱。
public:
IpcServerChannel(System::String ^ portName);
public IpcServerChannel(string portName);
new System.Runtime.Remoting.Channels.Ipc.IpcServerChannel : string -> System.Runtime.Remoting.Channels.Ipc.IpcServerChannel
Public Sub New (portName As String)
參數
- portName
- String
頻道使用的IPC埠名稱。
範例
以下程式碼範例說明如何使用此建構子。
// Create and register an IPC channel
IpcServerChannel^ serverChannel = gcnew IpcServerChannel( L"remote" );
ChannelServices::RegisterChannel( serverChannel );
// Create and register an IPC channel
IpcServerChannel serverChannel = new IpcServerChannel("remote");
ChannelServices.RegisterChannel(serverChannel);
適用於
IpcServerChannel(IDictionary, IServerChannelSinkProvider)
初始化一個具有指定通道屬性與 sink 的類別新實例 IpcServerChannel 。
public:
IpcServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public IpcServerChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Ipc.IpcServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Ipc.IpcServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider)
參數
- properties
- IDictionary
一個 IDictionary 集合,指定通道將使用的配置屬性值。
- sinkProvider
- IServerChannelSinkProvider
IServerChannelSinkProvider頻道將使用的實作。
範例
以下程式碼範例說明如何使用此建構子。
// 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 );
// 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);
備註
欲了解更多通道配置屬性,請參閱 通道與形式配置屬性。
如果你不需要匯入功能,請將參數設 sinkProvider 為 null。
注意事項
在參數中設定exclusiveAddressUse屬性為 時falseproperties,可以為同一命名管線註冊多個IpcServerChannel物件。 在這種情況下,請求可以發送到任何註冊的頻道。 此設定僅在同時使用 ALC 時被視為安全。
另請參閱
適用於
IpcServerChannel(String, String)
初始化一個新的類別實例 IpcServerChannel ,使用指定的通道名稱與 IPC 埠名。
public:
IpcServerChannel(System::String ^ name, System::String ^ portName);
public IpcServerChannel(string name, string portName);
new System.Runtime.Remoting.Channels.Ipc.IpcServerChannel : string * string -> System.Runtime.Remoting.Channels.Ipc.IpcServerChannel
Public Sub New (name As String, portName As String)
參數
- name
- String
頻道的名稱。
- portName
- String
頻道使用的IPC埠名稱。
範例
以下程式碼範例說明如何使用此建構子。
// Create the server channel.
String^ name = L"ipc";
String^ portName = L"localhost:9090";
IpcServerChannel^ serverChannel = gcnew IpcServerChannel( name,portName );
// Create the server channel.
string name = "ipc";
string portName = "localhost:9090";
IpcServerChannel serverChannel =
new IpcServerChannel(name, portName);
備註
此建構子透過參數ChannelName設定性質name。 如果你想註冊多個頻道,每個頻道必須有獨特的名稱。
適用於
IpcServerChannel(IDictionary, IServerChannelSinkProvider, CommonSecurityDescriptor)
初始化一個具備指定通道特性、sink 及安全描述符的新類別實例 IpcServerChannel 。
public:
IpcServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider, System::Security::AccessControl::CommonSecurityDescriptor ^ securityDescriptor);
public IpcServerChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider, System.Security.AccessControl.CommonSecurityDescriptor securityDescriptor);
new System.Runtime.Remoting.Channels.Ipc.IpcServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider * System.Security.AccessControl.CommonSecurityDescriptor -> System.Runtime.Remoting.Channels.Ipc.IpcServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider, securityDescriptor As CommonSecurityDescriptor)
參數
- properties
- IDictionary
一個 IDictionary 集合,指定通道將使用的配置屬性值。
- sinkProvider
- IServerChannelSinkProvider
IServerChannelSinkProvider頻道將使用的實作。
- securityDescriptor
- CommonSecurityDescriptor
A CommonSecurityDescriptor 被頻道使用。
備註
欲了解更多通道配置屬性,請參閱 通道與形式配置屬性。
如果你不需要匯入功能,請將參數設 sinkProvider 為 null。 若不需要安全描述符,將參數設 securityDescriptor 為 null。
注意事項
在參數中設定exclusiveAddressUse屬性為 時falseproperties,可以為同一命名管線註冊多個IpcServerChannel物件。 在這種情況下,請求可以發送到任何註冊的頻道。 此設定僅在同時使用 ALC 時被視為安全。
另請參閱
適用於
IpcServerChannel(String, String, IServerChannelSinkProvider)
初始化一個新的類別實例 IpcServerChannel ,使用指定的通道名稱、IPC 埠名和 sink。
public:
IpcServerChannel(System::String ^ name, System::String ^ portName, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public IpcServerChannel(string name, string portName, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Ipc.IpcServerChannel : string * string * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Ipc.IpcServerChannel
Public Sub New (name As String, portName As String, sinkProvider As IServerChannelSinkProvider)
參數
- name
- String
頻道的名稱。
- portName
- String
頻道使用的IPC埠名稱。
- sinkProvider
- IServerChannelSinkProvider
IServerChannelSinkProvider頻道將使用的實作。
範例
以下程式碼範例說明如何使用此建構子。
// Create the server channel.
String^ name = L"ipc";
String^ portName = L"localhost:9090";
IServerChannelSinkProvider^ sinkProvider = nullptr;
IpcServerChannel^ serverChannel = gcnew IpcServerChannel( name,portName,sinkProvider );
// Create the server channel.
string name = "ipc";
string portName = "localhost:9090";
IServerChannelSinkProvider sinkProvider = null;
IpcServerChannel serverChannel =
new IpcServerChannel(name, portName, sinkProvider);
備註
此建構子透過參數ChannelName設定性質name。 如果你想註冊多個頻道,每個頻道必須有獨特的名稱。
如果你不需要匯入功能,請將參數設 sinkProvider 為 null。