IpcServerChannel 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 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)
使用指定的 IPC 端口名称初始化类的新实例 IpcServerChannel 。
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)
使用指定的通道属性和接收器初始化类的新实例 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);
注解
有关通道配置属性的详细信息,请参阅 Channel 和 Formatter 配置属性。
如果不需要接收器功能,请将 sinkProvider 参数设置为 null。
注意
将 exclusiveAddressUse 属性设置为 false 参数中 properties 时,可以为同一命名管道注册多个 IpcServerChannel 对象。 在这种情况下,请求可以转到注册的任何通道。 仅当使用 ALC 时,此设置才被视为安全。
另请参阅
适用于
IpcServerChannel(String, String)
使用指定的通道名称和 IPC 端口名称初始化类的新实例 IpcServerChannel 。
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);
注解
此构造函数使用name参数设置ChannelName属性。 如果要注册多个通道,每个通道必须具有唯一的名称。
适用于
IpcServerChannel(IDictionary, IServerChannelSinkProvider, CommonSecurityDescriptor)
使用指定的通道属性、接收器和安全描述符初始化类的新实例 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 。
注解
有关通道配置属性的详细信息,请参阅 Channel 和 Formatter 配置属性。
如果不需要接收器功能,请将 sinkProvider 参数设置为 null。 如果不需要安全描述符,请将 securityDescriptor 参数设置为 null。
注意
将 exclusiveAddressUse 属性设置为 false 参数中 properties 时,可以为同一命名管道注册多个 IpcServerChannel 对象。 在这种情况下,请求可以转到注册的任何通道。 仅当使用 ALC 时,此设置才被视为安全。
另请参阅
适用于
IpcServerChannel(String, String, IServerChannelSinkProvider)
使用指定的通道名称、IPC 端口名称和接收器初始化类的新实例 IpcServerChannel 。
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);
注解
此构造函数使用name参数设置ChannelName属性。 如果要注册多个通道,每个通道必须具有唯一的名称。
如果不需要接收器功能,请将 sinkProvider 参数设置为 null。