ReceiveCompletedEventArgs.AsyncResult 属性

定义

获取或设置请求的异步操作的结果。

public:
 property IAsyncResult ^ AsyncResult { IAsyncResult ^ get(); void set(IAsyncResult ^ value); };
public IAsyncResult AsyncResult { get; set; }
member this.AsyncResult : IAsyncResult with get, set
Public Property AsyncResult As IAsyncResult

属性值

一个 IAsyncResult 包含与接收操作关联的数据。

注解

AsyncResult 标识正在进行的或已完成的异步操作。 该属性包含的数据有助于确定要完成的多个可能的异步操作中的哪一项,以及传递给事件处理程序时,允许 EndReceive 访问与已完成操作关联的消息。

调用 BeginReceive时,会立即返回 a IAsyncResult ,即使存在消息(如果存在)尚未检索,因为操作尚未完成。 指示 AsyncResult 异步操作的状态。 BeginReceive 创建在整个操作中修改的对象,直到 EndReceive 完成该对象。

适用于

另请参阅