Resolve Method (PeerName, Cloud, Int32)

PeerNameResolver.Resolve Method (PeerName, Cloud, Int32)

.NET Framework (current version)
 

Resolves the specified PeerName in the specified Cloud, returning no more than the specified number of PeerNameRecord objects.

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

[SecurityCriticalAttribute]
public PeerNameRecordCollection Resolve(
	PeerName peerName,
	Cloud cloud,
	int maxRecords
)

Parameters

peerName
Type: System.Net.PeerToPeer.PeerName

The PeerName to resolve.

cloud
Type: System.Net.PeerToPeer.Cloud

The Cloud in which to resolve the peerName.

maxRecords
Type: System.Int32

The maximum number of peer name record objects to obtain from the specified cloud for the specified peerName.

Return Value

Type: System.Net.PeerToPeer.PeerNameRecordCollection

A PeerNameRecordCollection whose size is less than or equal to maxRecords entries. This collection contains peer name records associated with the PeerName that was resolved.

Exception Condition
ArgumentNullException

The peerName parameter is set to null.

ArgumentOutOfRangeException

The maxRecords parameter is less than or equal to zero.

PeerToPeerException

The supplied peer name cannot be resolved.

For unsecured peer names, the same name can be registered (and associated with different endpoints) by different peers within the same cloud. If the peer name cannot be resolved, an PeerToPeerException is thrown.

For every Resolve method, there is an equivalent ResolveAsync method. Their parameter lists are identical, except that the ResolveAsync method includes a system token for asynchronous event handling.

If the Cloud parameter is null, the PeerNameResolver uses the Available shortcut to fill in the Name, Scope, and ScopeId.

The ResolveCompleted event will be raised if the resolve operation completes in error or is canceled.

.NET Framework
Available since 3.5
Return to top
Show:
© 2016 Microsoft