IChannelFactory<TChannel> 接口
定义
定义必须由创建特定类型通道的通道工厂实现的接口。Defines the interface that must be implemented by channel factories that create type-specific channels.
generic <typename TChannel>
public interface class IChannelFactory : System::ServiceModel::Channels::IChannelFactory
public interface IChannelFactory<TChannel> : System.ServiceModel.Channels.IChannelFactory
type IChannelFactory<'Channel> = interface
interface IChannelFactory
interface ICommunicationObject
Public Interface IChannelFactory(Of TChannel)
Implements IChannelFactory
类型参数
- TChannel
通道工厂创建的通道的类型。The type of channel that the channel factory creates.
- 派生
- 实现
注解
通过实现 IChannelFactory<TChannel> 协定,用户可以创建具有某种给定类型的多个通道,而不必每次都指定通道类型。Implementing the IChannelFactory<TChannel> contract allows users to create multiple channels of a given type without having to specify the channel type each time. 换言之,将通道类型定义为实现 IChannelFactory<TChannel> 接口的通道工厂的泛型参数,意味着无需将该类型传入 CreateChannel 方法。In other words, defining the channel type as a generic parameter for the channel factory implementing the IChannelFactory<TChannel> interface means that it is not necessary to pass the type into the CreateChannel methods. 如果用户希望创建不同的通道类型,则可以为所需要的每个通道类型创建其他通道工厂。If users want to create different channel types, they can create additional channel factories for each type of channel required. 利用 CreateChannel(EndpointAddress, Uri) 重载可以区分最初消息要发送到的地址与最终目标。The CreateChannel(EndpointAddress, Uri) overload allows you to distinguish the address to which the message is initially sent from the ultimate destination. 有关寻址的讨论,请参阅 地址 主题。For a discussion of addressing, see the Addresses topic.
属性
| State |
获取面向通信的对象的当前状态。Gets the current state of the communication-oriented object. (继承自 ICommunicationObject) |
方法
| Abort() |
使通信对象立即从其当前状态转换到关闭状态。Causes a communication object to transition immediately from its current state into the closed state. (继承自 ICommunicationObject) |
| BeginClose(AsyncCallback, Object) |
开始一个异步操作以关闭通信对象。Begins an asynchronous operation to close a communication object. (继承自 ICommunicationObject) |
| BeginClose(TimeSpan, AsyncCallback, Object) |
开始一个异步操作以在指定超时内关闭通信对象。Begins an asynchronous operation to close a communication object with a specified timeout. (继承自 ICommunicationObject) |
| BeginOpen(AsyncCallback, Object) |
开始一个异步操作以打开通信对象。Begins an asynchronous operation to open a communication object. (继承自 ICommunicationObject) |
| BeginOpen(TimeSpan, AsyncCallback, Object) |
开始一个异步操作以在指定时间间隔内打开通信对象。Begins an asynchronous operation to open a communication object within a specified interval of time. (继承自 ICommunicationObject) |
| Close() |
使通信对象从其当前状态转换到关闭状态。Causes a communication object to transition from its current state into the closed state. (继承自 ICommunicationObject) |
| Close(TimeSpan) |
使通信对象从其当前状态转换到关闭状态。Causes a communication object to transition from its current state into the closed state. (继承自 ICommunicationObject) |
| CreateChannel(EndpointAddress) |
创建到指定终结点地址的指定类型的通道。Creates a channel of a specified type to a specified endpoint address. |
| CreateChannel(EndpointAddress, Uri) |
创建指定类型的通道,该通道通向消息要发送到的指定终结点地址和传输地址。Creates a channel of a specified type to a specified endpoint address and transport address to which messages are sent. |
| EndClose(IAsyncResult) |
完成一个异步操作以关闭通信对象。Completes an asynchronous operation to close a communication object. (继承自 ICommunicationObject) |
| EndOpen(IAsyncResult) |
完成一个异步操作以打开通信对象。Completes an asynchronous operation to open a communication object. (继承自 ICommunicationObject) |
| GetProperty<T>() |
从通道堆栈的适当层返回所请求的类型化对象(如果存在)。Returns a typed object requested, if present, from the appropriate layer in the channel stack. (继承自 IChannelFactory) |
| Open() |
使通信对象从已创建状态转换到已打开状态。Causes a communication object to transition from the created state into the opened state. (继承自 ICommunicationObject) |
| Open(TimeSpan) |
使通信对象在指定时间间隔内从已创建状态转换到已打开状态。Causes a communication object to transition from the created state into the opened state within a specified interval of time. (继承自 ICommunicationObject) |
事件
| Closed |
当通信对象完成从正在关闭状态转换到已关闭状态时发生。Occurs when the communication object completes its transition from the closing state into the closed state. (继承自 ICommunicationObject) |
| Closing |
当通信对象首次进入正在关闭状态时发生。Occurs when the communication object first enters the closing state. (继承自 ICommunicationObject) |
| Faulted |
当通信对象首次进入出错状态时发生。Occurs when the communication object first enters the faulted state. (继承自 ICommunicationObject) |
| Opened |
当通信对象完成从正在打开状态转换到已打开状态时发生。Occurs when the communication object completes its transition from the opening state into the opened state. (继承自 ICommunicationObject) |
| Opening |
当通信对象首次进入正在打开状态时发生。Occurs when the communication object first enters the opening state. (继承自 ICommunicationObject) |