PeerRole enumeration

Applies to Windows and Windows Phone

Describes the role of the peer app when connected to multiple peers.


public enum class PeerRole




The PeerRole enumeration has these members.

Peer | peer0

The app is part of a two-peer connection.

Host | host1

The app is the host peer app in a multi-peer connection.

Client | client2

The app is a client peer app in a multi-peer connection.


The Role property is used in multi-peer app connections to identify whether the peer app is the Host or Client, or if the peer app is participating in a two-peer connection as a Peer. For multi-peer app connections, you must set the Role property before calling the Start method. If the Role property is not set, the default is Peer.

In a multi-peer app scenario, the Role identifies the capability of the apps to connect. A Host app can connect to up to four Client apps. Host apps can only discover apps that advertise as Client apps. Client apps can only discover apps that advertise as Host apps. The Peer role identifies a two-app scenario. Therefore, Peer apps can only discover other Peer apps. The same rules apply for peer apps connected using a tap gesture. For example, apps advertising as Host apps can only tap to connect with apps advertising as Client apps.


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


Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


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



See also

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



© 2014 Microsoft