WebClientAsyncResult.CompletedSynchronously 属性

定义

获取一个值,该值指示 Begin 调用是否已同步完成。Gets a value indicating whether the Begin call completed synchronously.

public:
 property bool CompletedSynchronously { bool get(); };
public bool CompletedSynchronously { get; }
member this.CompletedSynchronously : bool
Public ReadOnly Property CompletedSynchronously As Boolean

属性值

Boolean

如果 Begin 调用同步完成,则为 true;否则,为 falsetrue if the Begin call completed synchronously; otherwise, false.

实现

注解

如果在 CompletedSynchronously true 委托中设置为 AsyncCallback ,则调用的线程可能 BeginInvoke 是当前线程。If CompletedSynchronously is set to true within the AsyncCallback delegate, it is probable that the thread that called BeginInvoke is the current thread. 在这种情况下,应小心地从回调方法进行另一个异步 Begin 调用,因为如果调用继续同步完成,则它可能会导致堆栈增长而不受限制。In this case, you should be careful about making another asynchronous Begin call from the callback method, since it can cause the stack to grow without bound if the calls continue to complete synchronously. 相反,应在回调方法之外的原始调用站点上完成调用。Instead, the call should be completed at the original call site, outside the callback method.

适用于