PeerFinder.FindAllPeersAsync | findAllPeersAsync method

Applies to Windows and Windows Phone

Asynchronously browses for peer devices that are running the same app within wireless range.

Syntax


public:
static IAsyncOperation<IVectorView>^ FindAllPeersAsync()

Parameters

This method has no parameters.

Return value

Type: IAsyncOperation<IVectorView>

The asynchronous operation for browsing for peer devices that are running your app.

Remarks

If your app is running on a PC, you can browse for peer PCs that are running your app. Peer discovery in this case takes place over Wi-Fi Direct. If your app is running on a phone, you can browse for peer phones that are running your app. In this case, peer discovery takes place over Bluetooth. Because the transport used for peer discovery differs between PC and phone, your app running on a PC can only find peer PCs and your app running on a phone can only find peer phones.

When the asynchronous browsing operation finishes successfully, it returns a list of peers that are within wireless range. A peer is a device that has an app running in the foreground with a matching app Id. A peer can also have a matching browse Id that's specified as an alternate identity. For more information, see AlternateIdentities.

If an app calls the ConnectAsync method to create a connection with a peer, the app will no longer advertise for a connection and will not be found by the FindAllPeersAsync method until the app calls the Close method to close the socket connection.

You will only find peers where the device is within wireless range and the peer app is running in the foreground. If a peer app is running in the background, proximity does not advertise for peer connections.

As an alternative to the FindAllPeersAsync method, you can dynamically search for peer apps as they are discovered within range using the PeerWatcher object.

Windows Phone 8

Wi-Fi Direct is not supported on Windows Phone 8. For more information, see Proximity.

Examples

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

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking.Proximity
Windows::Networking::Proximity [C++]

Metadata

Windows.winmd

Capabilities

proximity
ID_CAP_PROXIMITY [Windows Phone]
ID_CAP_NETWORKING [Windows Phone]

See also

PeerFinder
AlternateIdentities
SupportedDiscoveryTypes
PeerWatcher
Proximity and Tapping (JavaScript)
Proximity and Tapping (C#/VB/C++)
Samples
Proximity sample

 

 

Show:
© 2014 Microsoft