1 out of 3 rated this helpful - Rate this topic

PeerFinder class

Applies to Windows and Windows Phone

Enables you to discover another instance of your app on a nearby device and create a socket connection between the peer apps by using a tap gesture or by browsing.

Syntax


public ref class PeerFinder abstract sealed 

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The PeerFinder class has these types of members:

Events

The PeerFinder class has these events.

EventDescription
ConnectionRequested Occurs when a remote peer requests a connection using the ConnectAsync method.
TriggeredConnectionStateChanged Occurs during a tap gesture from a remote peer.

 

Methods

The PeerFinder class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
ConnectAsync Connects to a peer discovered by a call to the FindAllPeersAsync method.
CreateWatcher Creates a new instance of a PeerWatcher object for dynamic discovery of peer apps.
FindAllPeersAsync Asynchronously browses for peer computers that are running the same app within wireless range.
Start() Starts the process of finding peer apps and makes an app discoverable to remote peers.
Start(String) Delivers a message to a peer app on a proximate device.
Stop Stops the process of finding peer apps or advertising for a peer connection.

 

Properties

The PeerFinder class has these properties.

PropertyAccess typeDescription

AllowBluetooth

Read/writeSpecifies whether the PeerFinder class may connect a StreamSocket object by using Bluetooth.

AllowInfrastructure

Read/writeSpecifies whether the PeerFinder class may connect to a StreamSocket object using TCP/IP.

AllowWiFiDirect

Read/writeSpecifies whether the PeerFinder class may connect a StreamSocket object by using Wi-Fi Direct.

AlternateIdentities

Read-onlyGets a list of alternate appId values to match with peer applications on other platforms.

DiscoveryData

Read/writeGets or sets the name that identifies your computer to remote peers.

DisplayName

Read/writeGets or sets the name that identifies your computer to remote peers.

Role

Read/writeGets or sets the role of the app in peer-to-peer connections.

SupportedDiscoveryTypes

Read-onlyGets a value that indicates which discovery options are available to use with the PeerFinder class.

 

Remarks

Important  

The proximity APIs do not provide authentication, encryption, or message integrity. Do not use proximity to exchange user sensitive information such as passwords, financial data, text messages, email, photographs, or government id numbers.

Examples

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

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

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

Proximity and Tapping (JavaScript)
Proximity and Tapping (C#/VB/C++)
Samples
Proximity sample

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.