通过


IpcChannel 构造函数

定义

初始化 IpcChannel 类的新实例。

重载

名称 说明
IpcChannel()

初始化类的新实例 IpcChannel ,仅激活客户端通道,而不是服务器通道。

IpcChannel(String)

使用侦听指定 IPC 端口的服务器通道初始化类的新实例 IpcChannel

IpcChannel(IDictionary, IClientChannelSinkProvider, IServerChannelSinkProvider)

使用指定的配置属性和接收器初始化类的新实例 IpcChannel

IpcChannel(IDictionary, IClientChannelSinkProvider, IServerChannelSinkProvider, CommonSecurityDescriptor)

使用指定的配置属性和接收器初始化类的新实例 IpcChannel

IpcChannel()

初始化类的新实例 IpcChannel ,仅激活客户端通道,而不是服务器通道。

public:
 IpcChannel();
public IpcChannel();
Public Sub New ()

示例

下面的代码示例演示如何使用此构造函数。 该代码示例是 IpcChannel 类中的一个较大示例的一部分。

// Create the channel.
IpcChannel^ channel = gcnew IpcChannel;
// Create the channel.
IpcChannel channel = new IpcChannel();

适用于

IpcChannel(String)

使用侦听指定 IPC 端口的服务器通道初始化类的新实例 IpcChannel

public:
 IpcChannel(System::String ^ portName);
public IpcChannel(string portName);
new System.Runtime.Remoting.Channels.Ipc.IpcChannel : string -> System.Runtime.Remoting.Channels.Ipc.IpcChannel
Public Sub New (portName As String)

参数

portName
String

IPC 端口的名称。

示例

下面的代码示例演示如何使用此构造函数。 该代码示例是 IpcChannel 类中的一个较大示例的一部分。

// Create the server channel.
IpcChannel^ serverChannel = gcnew IpcChannel( L"localhost:9090" );
// Create the server channel.
IpcChannel serverChannel =
    new IpcChannel("localhost:9090");

适用于

IpcChannel(IDictionary, IClientChannelSinkProvider, IServerChannelSinkProvider)

使用指定的配置属性和接收器初始化类的新实例 IpcChannel

public:
 IpcChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ clientSinkProvider, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ serverSinkProvider);
public IpcChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IClientChannelSinkProvider clientSinkProvider, System.Runtime.Remoting.Channels.IServerChannelSinkProvider serverSinkProvider);
new System.Runtime.Remoting.Channels.Ipc.IpcChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IClientChannelSinkProvider * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Ipc.IpcChannel
Public Sub New (properties As IDictionary, clientSinkProvider As IClientChannelSinkProvider, serverSinkProvider As IServerChannelSinkProvider)

参数

properties
IDictionary

一个 IDictionary 集合,指定客户端和服务器通道要使用的配置属性的值。

clientSinkProvider
IClientChannelSinkProvider

IClientChannelSinkProvider客户端通道要使用的实现。

serverSinkProvider
IServerChannelSinkProvider

服务器 IServerChannelSinkProvider 通道要使用的实现。

示例

下面的代码示例演示如何使用此构造函数。 该代码示例是 IpcChannel 类中的一个较大示例的一部分。

// 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";
IpcChannel^ serverChannel = gcnew IpcChannel( properties,nullptr,nullptr );
// Create the server channel.
System.Collections.IDictionary properties =
    new System.Collections.Hashtable();
properties["name"] = "ipc";
properties["priority"] = "20";
properties["portName"] = "localhost:9090";
IpcChannel serverChannel = new IpcChannel(properties, null, null);

注解

通道接收器提供一个插件点,允许访问流经通道的基础消息以及传输机制用于将消息发送到远程对象的流。 通道接收器还负责在客户端和服务器之间传输消息。 通道接收器在链中链接在一起,所有通道消息在最终序列化和传输消息之前会流经此接收器链。 如果不需要接收器功能,请将 clientSinkProviderserverSinkProvider 参数设置为 null

注意

exclusiveAddressUse 属性设置为 false 参数中 properties 时,可以为同一命名管道注册多个 IpcServerChannel 对象。 在这种情况下,请求可以转到注册的任何通道。 仅当使用 ALC 时,此设置才被视为安全。

适用于

IpcChannel(IDictionary, IClientChannelSinkProvider, IServerChannelSinkProvider, CommonSecurityDescriptor)

使用指定的配置属性和接收器初始化类的新实例 IpcChannel

public:
 IpcChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ clientSinkProvider, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ serverSinkProvider, System::Security::AccessControl::CommonSecurityDescriptor ^ securityDescriptor);
public IpcChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IClientChannelSinkProvider clientSinkProvider, System.Runtime.Remoting.Channels.IServerChannelSinkProvider serverSinkProvider, System.Security.AccessControl.CommonSecurityDescriptor securityDescriptor);
new System.Runtime.Remoting.Channels.Ipc.IpcChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IClientChannelSinkProvider * System.Runtime.Remoting.Channels.IServerChannelSinkProvider * System.Security.AccessControl.CommonSecurityDescriptor -> System.Runtime.Remoting.Channels.Ipc.IpcChannel
Public Sub New (properties As IDictionary, clientSinkProvider As IClientChannelSinkProvider, serverSinkProvider As IServerChannelSinkProvider, securityDescriptor As CommonSecurityDescriptor)

参数

properties
IDictionary

一个 IDictionary 集合,指定客户端和服务器通道要使用的配置属性的值。

clientSinkProvider
IClientChannelSinkProvider

IClientChannelSinkProvider客户端通道要使用的实现。

serverSinkProvider
IServerChannelSinkProvider

服务器 IServerChannelSinkProvider 通道要使用的实现。

securityDescriptor
CommonSecurityDescriptor

安全描述符。

适用于