语言

IChannel 接口

定义

定义所有通道对象必须实现的基本接口。 它要求它们实现由所有通信对象共享的状态机接口,并实现从通道堆栈中检索对象的方法。

public interface class IChannel : System::ServiceModel::ICommunicationObject
public interface IChannel : System.ServiceModel.ICommunicationObject
type IChannel = interface
    interface ICommunicationObject
Public Interface IChannel
Implements ICommunicationObject
派生
实现

注解

Important

从实现此接口且不受信任的数据的类调用方法存在安全风险。 从仅使用受信任数据的实现此接口的类调用方法。 有关详细信息,请参阅验证所有输入。

通道必须满足接口定义的 ICommunicationObject 状态机协定。

该 IChannel 接口添加

GetProperty 接口的方法 ICommunicationObject 。 此方法提供一种机制,用于从通道堆栈中检索属性,而不管这些属性位于何处。 方法名称中的术语“property”是指属于堆栈中某个通道的信息片段。 该属性的 CLR 类型由 T. 通道工厂和通道侦听器也使用此检索方法。

IChannel 由与基本消息交换模式关联的每个通道接口继承:

属性

名称 说明
State

获取面向通信的对象的当前状态。

(继承自 ICommunicationObject)

方法

名称 说明
Abort()

使通信对象立即从其当前状态转换为关闭状态。

(继承自 ICommunicationObject)
BeginClose(AsyncCallback, Object)

开始异步操作以关闭通信对象。

(继承自 ICommunicationObject)
BeginClose(TimeSpan, AsyncCallback, Object)

开始异步操作以关闭具有指定超时的通信对象。

(继承自 ICommunicationObject)
BeginOpen(AsyncCallback, Object)

开始异步操作以打开通信对象。

(继承自 ICommunicationObject)
BeginOpen(TimeSpan, AsyncCallback, Object)

开始一个异步操作,以在指定的时间间隔内打开通信对象。

(继承自 ICommunicationObject)
Close()

使通信对象从其当前状态转换为关闭状态。

(继承自 ICommunicationObject)
Close(TimeSpan)

使通信对象从其当前状态转换为关闭状态。

(继承自 ICommunicationObject)
EndClose(IAsyncResult)

完成异步操作以关闭通信对象。

(继承自 ICommunicationObject)
EndOpen(IAsyncResult)

完成异步操作以打开通信对象。

(继承自 ICommunicationObject)
GetProperty<T>()

从通道堆栈中的相应层返回所请求的类型化对象(如果存在)。

Open()

使通信对象从创建的状态转换为打开状态。

(继承自 ICommunicationObject)
Open(TimeSpan)

使通信对象在指定的时间间隔内从创建的状态转换为打开状态。

(继承自 ICommunicationObject)

事件

名称 说明
Closed

当通信对象完成从结束状态到关闭状态的转换时发生。

(继承自 ICommunicationObject)
Closing

通信对象首次进入结束状态时发生。

(继承自 ICommunicationObject)
Faulted

通信对象首次进入错误状态时发生。

(继承自 ICommunicationObject)
Opened

当通信对象完成从打开状态到打开状态的转换时发生。

(继承自 ICommunicationObject)
Opening

通信对象首次进入打开状态时发生。

(继承自 ICommunicationObject)

适用于