This documentation is archived and is not being maintained.

PeerCollaboration::GetPeersNearMe Method

Returns a collection of all the PeerCollaboration endpoints currently signed in on the network subnet of the calling peer.

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

public:
static PeerNearMeCollection^ GetPeersNearMe()

Return Value

Type: System.Net.PeerToPeer.Collaboration::PeerNearMeCollection
A PeerNearMeCollection that contains all the PeerCollaboration endpoints currently signed into the 'Near Me' scope.
If peers are not discovered on the subnet, a collection of size zero (0) is returned.

ExceptionCondition
InvalidOperationException

The peer is not signed in to the 'Near Me' scope.

PeerToPeerException

An invalid value was returned when this method attempted to enumerate all known People Near Me endpoints.

The return of a fully populated PeerNearMeCollection via this method can require an indeterminate amount of time after sign-in depending on network topology and latency.

Calling this method requires a PermissionState of Unrestricted. This state is created when the Peer collaboration session begins.

The following code example illustrates how to retrieve PeersNearMe as a PeerNearMeCollection:

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

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