Export (0) Print
Expand All

PeerNameResolver.ResolveAsyncCancel Method

Cancels the specified asynchronous peer name resolution request.

Namespace:  System.Net.PeerToPeer
Assembly:  System.Net (in System.Net.dll)

public void ResolveAsyncCancel(
	Object userState


Type: System.Object

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


The userState parameters cannot be null.

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.

.NET Framework

Supported in: 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft