IpcChannel 构造函数

定义

初始化 IpcChannel 类的新实例。

重载

IpcChannel()

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

IpcChannel(String)

使用侦听指定端口的服务器信道初始化 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)

使用侦听指定端口的服务器信道初始化 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

注意

在 参数中propertiesexclusiveAddressUse 属性设置为 false 时,可以为同一命名管道注册多个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

安全说明符。

适用于