PeerNameResolver::Resolve Method (PeerName^, Int32)

 

Resolves the specified peer name in all clouds known to the calling peer, returning no more than the specified number of PeerNameRecord objects.

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

public:
PeerNameRecordCollection^ Resolve(
	PeerName^ peerName,
	int maxRecords
)

Parameters

peerName
Type: System.Net.PeerToPeer::PeerName^

The PeerName to resolve.

maxRecords
Type: System::Int32

The maximum number of PeerNameRecord objects to obtain from all Cloud objects for the supplied 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.

This method associates a peer name to clouds. All clouds are queried for the peer name. For unsecured peer names, the same peer name can be registered by different users in the same Cloud, and associated with different endpoints. If the PeerName cannot be resolved (for example, the peer name is not published) 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.

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: