IContextChannel 接口

定义

定义通道的上下文控件接口。Defines the interface for the context control of a channel.

public interface class IContextChannel : System::ServiceModel::Channels::IChannel, System::ServiceModel::IExtensibleObject<System::ServiceModel::IContextChannel ^>
public interface IContextChannel : System.ServiceModel.Channels.IChannel, System.ServiceModel.IExtensibleObject<System.ServiceModel.IContextChannel>
type IContextChannel = interface
    interface IChannel
    interface ICommunicationObject
    interface IExtensibleObject<IContextChannel>
Public Interface IContextChannel
Implements IChannel, IExtensibleObject(Of IContextChannel)
派生
实现

注解

重要

使用不受信任的数据从实现此接口的类中调用方法存在安全风险。Calling methods from classes that implement this interface with untrusted data is a security risk. 仅使用受信任的数据从实现此接口的类中调用方法。Call the methods from classes that implement this interface only with trusted data. 有关详细信息,请参阅数据验证For more information, see Data Validation.

IContextChannel 为通道上下文定义控件。The IContextChannel defines the controls for the context of a channel. 这包括通道的 SessionIdInputSessionOutputSessionAllowOutputBatching,以及参与会话的终结点的 LocalAddressRemoteAddressThis includes the SessionId, InputSession, OutputSession, and AllowOutputBatching for the channel, and the LocalAddress and RemoteAddress for the endpoints participating in the session. IContextChannel 接口构成了 IServiceChannelIClientChannel 接口的一部分以及 IDuplexContextChannel 接口。The IContextChannel interface forms part of the IServiceChannel and IClientChannel interfaces and of the IDuplexContextChannel interface.

属性

AllowOutputBatching

获取或设置一个值,该值指示 Windows Communication Foundation (WCF) 在给出消息以进行传输之前存储一组消息。Gets or sets a value that instructs Windows Communication Foundation (WCF) to store a set of messages before giving the messages to the transport.

Extensions

获取此可扩展对象的扩展对象集合。Gets a collection of extension objects for this extensible object.

(继承自 IExtensibleObject<T>)
InputSession

获取通道的输入会话。Gets the input session for the channel.

LocalAddress

获取通道的本地终结点。Gets the local endpoint for the channel.

OperationTimeout

获取或设置一个时间段,操作必须在此时间段内完成否则将引发异常。Gets or sets the time period within which an operation must complete or an exception is thrown.

OutputSession

获取与通道关联的输出会话(如果有)。Gets the output session associated with the channel, if any.

RemoteAddress

获取与通道关联的远程地址。Gets the remote address associated with the channel.

SessionId

返回当前会话的标识符(如果有)。Returns an identifier for the current session, if any.

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)
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.

(继承自 IChannel)
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)

适用于