PeerNameResolver.ResolveAsyncCancel(Object) Method

Definition

Cancels the specified asynchronous peer name resolution request.

public:
 void ResolveAsyncCancel(System::Object ^ userState);
[System.Security.SecurityCritical]
public void ResolveAsyncCancel (object userState);
[<System.Security.SecurityCritical>]
member this.ResolveAsyncCancel : obj -> unit
Public Sub ResolveAsyncCancel (userState As Object)

Parameters

userState
Object

The object provided to the ResolveAsync method instance which started the resolve operation.

Attributes

Exceptions

The userState parameters cannot be null.

Remarks

Calling this method guarantees the system will not attempt to obtain additional records for the specified PeerName. If this method is called when an asynchronous peer name resolution operation is not outstanding, it acts as a "no operation" (NO OP).

The userState object must be provided since it is used to track a specific asynchronous call when multiple calls are in progress. This caller-supplied object is unique for each peer name resolution request.

This method will return immediately, but the operation may or may not immediately cancel. The event arguments returned by the ResolveCompleted event contains a field which can be polled by clients to determine whether cancellation occurred.

Calling this method ensures the ResolveCompleted event will be signaled as soon as possible with the event argument Cancelled set to true.

Applies to

See also