PeerFinder class
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
Attributes
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.Networking.Proximity.IPeerFinderStatics, NTDDI_WIN8)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The PeerFinder class has these types of members:
Events
The PeerFinder class has these events.
| Event | Description |
|---|---|
| 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.
| Method | Description |
|---|---|
| ConnectAsync | Connects to a peer discovered by a call to the FindAllPeersAsync method. |
| 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.
| Property | Access type | Description |
|---|---|---|
| Read/write | Specifies whether the PeerFinder class may connect a StreamSocket object by using Bluetooth. | |
| Read/write | Specifies whether the PeerFinder class may connect to a StreamSocket object using TCP/IP. | |
| Read/write | Specifies whether the PeerFinder class may connect a StreamSocket object by using Wi-Fi Direct. | |
| Read-only | Gets a list of alternate appId values to match with peer applications on other platforms. | |
| Read/write | Gets or sets the name that identifies your computer to remote peers. | |
| Read-only | Gets a value that indicates which discovery options are available to use with the PeerFinder class. |
Examples
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 |
|
|
Metadata |
|
|
Capabilities |
|
See also
Build date: 2/25/2013