Windows Peer-to-Peer Networking with the Windows SDK
Have you seen the Windows SDK samples that demonstrate the use of the P2P Native APIs? The samples are installed by default to the C:\Program Files\Microsoft SDKs\Windows\V6.1\Samples\NetDs\PeerToPeer \Samples\NetDS\PeerToPeer folder (see a list below). Peer-to-Peer Networking provides peer-to-peer protocols, an application platform, and user experiences that ship in Windows. There’s a nice (growing) list of whitepapers, presentations and code samples on P2P technologies at https://www.microsoft.com/p2p.
Whitepapers
Introduction to Windows Peer-to-Peer Networking
The scenarios, underlying technologies, and benefits of the Peer-to-Peer Networking platform.
Peer Name Resolution Protocol
How the Peer Name Resolution Protocol (PNRP) works, why it is important, and where it can be used.
People Near Me
How P2P technologies enable discovery of people located nearby so that you can start interacting with them in a variety of scenarios.
Harness the Power of P2P Communication in Windows Vista and Windows Communication Foundation
How to build scalable, high performance, large scale messaging solutions for use in collaboration and content distribution scenarios.
P2P Samples in the Windows SDK
Collaboration Sample
The Collaboration sample is a console based application. The goal of the application is to demonstrate proper use of the Collaboration APIs. Specifically, it demonstrates how to:
· Sign In, Sign Out and display Sign In Options
· Set and get your endpoint name
· Display endpoint information
· Enumerate People Near Me
· Add a People Near Me endpoint to contacts
· Export, Parse, Import and Delete contacts
· Enumerate contacts
· Watch a contact's presence changes
· Give a contact permission to watch you for presence changes
· Get presence information for an endpoint
· Set your presence information
· Subscribe and Unsubscribe from an endpoint
· Publish an object and stop publishing an object
· Register and Unregister a application for collaboration
· Display applications registered for collaboration
· Send an Invitation to an endpoint to participate in a collaboration session
· Upon accepting an invite launch a collaboration session and access data sent with the invitation
Graph Chat Sample
The Graph Chat Sample Application is a simple chat application demonstrating how to use the Peer-to-Peer Graphing API. There are 2 versions of this sample; make sure you use the correct sample for your OS. The XP version demonstrates how to use the Peer Name Resolution Protocol (PNRP) with the Winsock2 API. Any address provider can be used. The Vista version demonstrates how to use the PNRP via the PNRP APIs. More specifically, the application demonstrates:
· Creating a graph
· Connecting to an existing graph
· Disconnecting from an existing graph
· Enumerating Peer-to-Peer entities
· Adding records to the graph
· Using direct connections with a graph
· Using the notification and event infrastructure with graphs
· Registering names with PNRP
· Resolving names with PNRP
· Unregistering names with PNRP
Group Chat Sample
The Group Chat Sample Application is a simple chat application demonstrating how to use the Peer-to-Peer Grouping and Identity Manager API. (There are 2 versions of this sample; make sure you use the correct sample for your OS.) The application demonstrates:
· Creating an identity
· Creating and obtaining identity information
· Enumerating identities
· Enumerating groups associated with an identity
· Creating a group
· Creating invitations for a group
· Connecting to an existing group
· Disconnecting from an existing group
· Extracting information from the group properties
· Using direct connections with a group
· Using the enumeration functions within a group
· Enumerating group members
· Adding records to a group
· Using the notification and event infrastructure with groups
Naming APIs Sample
The Naming APIs samples come in two pieces:
· Email Name Resolution
The Email Name Resolution sample demonstrates how, using Winsock, an application can publish email names through a variety of underlying provider systems. The sample shows the use of the new Winsock api SetAddrInfoEx which can be used to add (or remove) email address / ip address pairs to a naming provider. After an email address has been added to a provider, it may be used in place of hostnames -- for example "ping user@sampleprovider.net" will work. Note that this sample is best used in conjunction with the NS_EMAIL Provider sample.
· NS_EMAIL Provider
A naming provider extends the functionality of winsock such that email addresses may be used in place of hostnames for a particular domain. This sample provider demonstrates adding a new provider for email addresses ending in "@sampleprovider.net". After building the provider, use "SampleProvider.Exe /install" to install the provider, then simply run it to have it interact with "@sampleprovider.net" email addresses.
Peer Name Resolution Protocol Sample
The Peer Name Resolution Protocol (PNRP) sample is a console based application. The goal of the application is to demonstrate proper use of the PNRP APIs. Specifically, it demonstrates how to:
· Register a peer name
· Resolve a peer name
· Enumerate the available clouds
You can also use the Peer-to-Peer (P2P) Networking MSDN forum or P2P team blog to learn tips and tricks, upcoming features, beta opportunities, and get to know the P2P team. This is one of my favorite teams to work with!
Comments
Anonymous
August 08, 2007
Have you seen the Windows SDK samples that demonstrate the use of the P2P Native APIs? The samples areAnonymous
December 05, 2007
Hi, We have tried interop scenario between WXP SP2 and SP3 with SDK end to end scenario. The Graph chat and Group chat applications are failing. In Group chat application following scenarios were tried: - 1.Group Created on WXP SP3 machine and created invitation for WXP SP2 Machine. WXP SP2 Machine was not able to join the Group. 2.Group Created on WXP SP3 machine and created invitation for another WXP SP3 Machine. Both XP SP3 Machines were able to chat with each other with SDK sample application. The version of the SDK I ma using is 1.0. My question is: Are SP2 and SP3 boxes allowed to intercommunicate over the SDK? How the inter operation is possible using the SDK?