IReplyChannel 接口

定义

定义一个接口,通道必须实现该接口,才能成为消息传递终结点之间的请求-回复通信的接收端。Defines the interface that a channel must implement to be on the receiving side of a request-reply communication between messaging endpoints.

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

注解

重要

使用不受信任的数据从实现此接口的类中调用方法存在安全风险。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.

IReplyChannel 接口包含 ReceiveRequest 方法的同步和异步版本,返回一个 RequestContext,用于构造接收的请求的回复。The IReplyChannel interface includes synchronous and asynchronous variants of a ReceiveRequest method return an RequestContext that can be used to construct replies to received requests.

协定包含接收、试图接收和等待消息功能的同步和异步版本。The contract includes synchronous and asynchronous variants of receive, try-to-receive and wait-for-a-message functionality.

IReplyChannel 不一定绑定到单个发送方。An IReplyChannel is not necessarily bound to a single sender. 其他通道和通道接口提供发送方和回复通道之间的关联,但基协定没有这样的限制。Other channels and channel interfaces provide correlation between the sender and the reply channel, but the base contract makes no such restriction.

提取模式与 IReplyChannel 一起用于接收消息。The pull model is used with an IReplyChannel to receive messages. 此模式的操作方式是先调用 ReceiveRequest(或其变化版本之一),然后等待消息到达。This model consists of calling ReceiveRequest (or one of its variants) and then waiting for a message to arrive.

属性

LocalAddress

获取回复通道接收消息的地址。Gets the address on which this reply channel receives messages.

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)
BeginReceiveRequest(AsyncCallback, Object)

开始用于接收可用请求的异步操作,该操作具有默认的超时值。Begins an asynchronous operation to receive an available request with a default timeout.

BeginReceiveRequest(TimeSpan, AsyncCallback, Object)

开始用于接收可用请求的异步操作,该操作具有指定的超时值。Begins an asynchronous operation to receive an available request with a specified timeout.

BeginTryReceiveRequest(TimeSpan, AsyncCallback, Object)

开始用于接收请求消息的异步操作,该操作具有指定的超时值和状态对象与之关联。Begins an asynchronous operation to receive a request message that has a specified time out and state object associated with it.

BeginWaitForRequest(TimeSpan, AsyncCallback, Object)

开始具有关联的指定超时值和状态对象的异步请求操作。Begins an asynchronous request operation that has a specified time out and state object associated with it.

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)
EndReceiveRequest(IAsyncResult)

完成用于接收可用请求的异步操作。Completes an asynchronous operation to receive an available request.

EndTryReceiveRequest(IAsyncResult, RequestContext)

完成用于接收请求消息的指定异步操作。Completes the specified asynchronous operation to receive a request message.

EndWaitForRequest(IAsyncResult)

完成指定的异步等待请求消息操作。Completes the specified asynchronous wait-for-a-request message operation.

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)
ReceiveRequest()

如果有可用的上下文,则返回接收到的请求的上下文。Returns the context of the request received, if one is available. 如果没有可用的上下文,则等到有可用上下文为止。If a context is not available, waits until there is one available.

ReceiveRequest(TimeSpan)

如果有可用的上下文,则返回接收到的请求的上下文。Returns the context of the request received, if one is available. 如果没有可用的上下文,则等到有可用上下文为止。If a context is not available, waits until there is one available.

TryReceiveRequest(TimeSpan, RequestContext)

返回一个值,该值指示是否在经历指定的时间间隔之前接收到请求。Returns a value that indicates whether a request is received before a specified interval of time elapses.

WaitForRequest(TimeSpan)

返回一个值,该值指示是否在经历指定的时间间隔之前接收到请求消息。Returns a value that indicates whether a request message is received before a specified interval of time elapses.

事件

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)

适用于