IpcClientChannel 构造函数

定义

初始化 IpcServerChannel 类的新实例。

重载

IpcClientChannel()

初始化 IpcServerChannel 类的新实例。

IpcClientChannel(IDictionary, IClientChannelSinkProvider)

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

IpcClientChannel(String, IClientChannelSinkProvider)

使用指定的名称和接收器初始化 IpcClientChannel 类的新实例。

IpcClientChannel()

初始化 IpcServerChannel 类的新实例。

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

示例

下面的代码示例演示如何使用此构造函数。

IpcClientChannel^ clientChannel = gcnew IpcClientChannel;
ChannelServices::RegisterChannel( clientChannel );
IpcClientChannel clientChannel = new IpcClientChannel();
ChannelServices.RegisterChannel(clientChannel);

注解

此构造函数返回的 TcpClientChannel 实例的配置属性全部设置为其默认值。 下表显示了每个配置属性的默认值。

Configuration 属性 说明
name 默认名称为“ipc client”。 每个信道都必须有唯一的名称。
priority 默认优先级为 1。

适用于

IpcClientChannel(IDictionary, IClientChannelSinkProvider)

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

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

参数

properties
IDictionary

一个 IDictionary 集合,它为信道要使用的配置属性指定值。

sinkProvider
IClientChannelSinkProvider

信道要使用的 IServerChannelSinkProvider 实现。

示例

下面的代码示例演示如何使用此构造函数。

// Create the client channel.
System::Collections::IDictionary^ properties = gcnew System::Collections::Hashtable;
properties->default[ L"name" ] = L"ipc client";
properties->default[ L"priority" ] = L"1";
IClientChannelSinkProvider^ sinkProvider = nullptr;
IpcClientChannel^ clientChannel = gcnew IpcClientChannel( properties,sinkProvider );
// Create the client channel.
System.Collections.IDictionary properties =
    new System.Collections.Hashtable();
properties["name"] = "ipc client";
properties["priority"] = "1";
System.Runtime.Remoting.Channels.IClientChannelSinkProvider
    sinkProvider = null;
IpcClientChannel clientChannel =
    new IpcClientChannel(properties, sinkProvider);

注解

有关通道配置属性的详细信息,请参阅 通道和格式化程序配置属性

如果不需要接收器功能,请将 sinkProvider 参数设置为 null

另请参阅

适用于

IpcClientChannel(String, IClientChannelSinkProvider)

使用指定的名称和接收器初始化 IpcClientChannel 类的新实例。

public:
 IpcClientChannel(System::String ^ name, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public IpcClientChannel (string name, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Ipc.IpcClientChannel : string * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Ipc.IpcClientChannel
Public Sub New (name As String, sinkProvider As IClientChannelSinkProvider)

参数

name
String

信道的名称。

sinkProvider
IClientChannelSinkProvider

信道要使用的 IClientChannelSinkProvider 实现。

示例

下面的代码示例演示如何使用此构造函数。

// Create the client channel.
String^ name = L"ipc client";
IClientChannelSinkProvider^ sinkProvider = nullptr;
IpcClientChannel^ clientChannel = gcnew IpcClientChannel( name,sinkProvider );
// Create the client channel.
string name = "ipc client";
System.Runtime.Remoting.Channels.IClientChannelSinkProvider
    sinkProvider = null;
IpcClientChannel clientChannel =
    new IpcClientChannel(name, sinkProvider);

注解

此构造函数使用 name 参数设置 ChannelName 属性。 如果要注册多个通道,每个通道必须具有唯一的名称。

如果不需要接收器功能,请将 sinkProvider 参数设置为 null

适用于