IpcClientChannel 构造函数

定义

初始化 IpcServerChannel 类的新实例。Initializes a new instance of the IpcServerChannel class.

重载

IpcClientChannel()

初始化 IpcServerChannel 类的新实例。Initializes a new instance of the IpcServerChannel class.

IpcClientChannel(IDictionary, IClientChannelSinkProvider)

使用指定的配置属性和接收器初始化 IpcClientChannel 类的新实例。Initializes a new instance of the IpcClientChannel class with the specified configuration properties and sink.

IpcClientChannel(String, IClientChannelSinkProvider)

使用指定的名称和接收器初始化 IpcClientChannel 类的新实例。Initializes a new instance of the IpcClientChannel class with the specified name and sink.

IpcClientChannel()

初始化 IpcServerChannel 类的新实例。Initializes a new instance of the IpcServerChannel class.

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

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

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

注解

TcpClientChannel此构造函数返回的实例的配置属性都设置为其默认值。The configuration properties of the TcpClientChannel instance returned by this constructor are all set to their default values. 下表显示了每个配置属性的默认值。The following table shows the default value for each configuration property.

配置属性Configuration property 描述Description
name 默认名称为 "ipc client"。The default name is "ipc client". 每个信道都必须有唯一的名称。Each channel must have a unique name.
priority 默认优先级为1。The default priority is 1.

适用于

IpcClientChannel(IDictionary, IClientChannelSinkProvider)

使用指定的配置属性和接收器初始化 IpcClientChannel 类的新实例。Initializes a new instance of the IpcClientChannel class with the specified configuration properties and sink.

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 集合,它为信道要使用的配置属性指定值。A IDictionary collection that specifies values for configuration properties to be used by the channel.

sinkProvider
IClientChannelSinkProvider

信道要使用的 IServerChannelSinkProvider 实现。The IServerChannelSinkProvider implementation to be used by the channel.

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// 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);

注解

有关通道配置属性的详细信息,请参阅通道和格式化程序配置属性For more information about channel configuration properties, see Channel and Formatter Configuration Properties.

如果不需要接收器功能,请将参数设置 sinkProvidernullIf you do not require sink functionality, set the sinkProvider parameter to null.

适用于

IpcClientChannel(String, IClientChannelSinkProvider)

使用指定的名称和接收器初始化 IpcClientChannel 类的新实例。Initializes a new instance of the IpcClientChannel class with the specified name and sink.

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

信道的名称。The name of the channel.

sinkProvider
IClientChannelSinkProvider

信道要使用的 IClientChannelSinkProvider 实现。The IClientChannelSinkProvider implementation to be used by the channel.

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// 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);

注解

此构造函数 ChannelName 使用参数设置属性 nameThis constructor sets the ChannelName property by using the name parameter. 如果要注册多个通道,则每个通道都必须具有唯一的名称。If you want to register more than one channel, each channel must have a unique name.

如果不需要接收器功能,请将参数设置 sinkProvidernullIf you do not require sink functionality, set the sinkProvider parameter to null.

适用于