The GraphChat Sample Application demonstrates the use of a subset of the Peer-to-Peer APIs centered around Graphing, People Near Me and Application Invite. It shows a multiparty chat application built using Graphing.
Platforms supported
· Windows Vista (except Starter Edition)
· Windows 7
To Build:
· In a SDK command shell, navigate to the directory containing this sample and run "nmake"; or
· Launch the .sln file in Visual Studio .NET
To Run:
· Type graphchat.exe (located in the Vista_DEBUG or WIN7_[ARCH]_DEBUG folder in the directory containing the sample)
· Just use the UI! To get started, try executing the following scenarios:
1. Create a graph
a) Launch the GraphChat application.
b) If this is the first time signing in to People Near Me, a dialog will display. Enter a display name and select the default option to Allow invitations from Anyone (a user can later modify these settings from Control Panel\Network and Internet\People Near Me ).
c) Select “Graph", then "New Graph" from the menu to create a new graph.
d) Type in free text strings for GraphName and CreatorId. Select "Local" scope for the graph.
2. Connect to an existing graph
a) Launch several more instances of the GraphChat application, either on the same computer or on other computers connected to the same IPv6 subnet.
b) On these additional instances, Select “Graph" then "Open Graph” from the menu. Enter in the GraphName used before and a unique MyPeerId for each instance.
c) As each application connects, notice the Graph Events and Graph Neighbors of each node display in their recpective panes of teh UI. When only a few nodes exist, the graph will be fully connected, with everyone connected to everyone else. If more nodes are added, notice that the graph is not fully connected but forms a mesh where no one node is overburdened with a large number of connections.
d) Type in a message at a few of the nodes and see it flood to all of the other nodes.
3. Synchronizing with a graph after recovering connectivity.
a) Start with the graph established in the scenarios above, with at least a few different computers connected to the graph and a few nodes running on each computer.
b) Interrupt the network connectivity on one computer (for example, disconnect the network cable).
c) The graph is now split. Enter a few messages on various nodes. All the nodes running on the isolated computer share the messages between each other and all the nodes on the remaining connected computers also share their messages.
d) Reestablish the network connectivity of the isolated computer. After network connectivity is restored, the graph will reconnect to the mesh and synchronize the messages generated while in the split state.
4. Recovering after all neighbors disconnect.
a) Start with the graph established in the scenarios above.
b) The Node ID of each node is displayed toward the right of the bottom status bar in the UI. The “Graph Neighbors” list box shows the neighbors to which a given node is connected.
c) Locate and disconnect from the mesh all the neighbors to which a particular node is connected. Within a short period of time the isolated node will use PNRP to discover remaining nodes and reconnect to the graph.
d) If messages were generated before the reconnection occurred, either on the disconnected node or on other nodes, the graph will now synchronize those messages to all nodes.
5. Send an Invitation to join Graph Chat
a) Start with the graph established in the scenarios above.
b) On a separate computer, open GraphChat at least once and then close it completely. Opening GraphChat causes it to register as a Collaboration application. This is a common task that a production application would perform. This computer will be the “target” of the invite.
c) Ensure that the target computer is signed in to PNM and set the option to Allow invitations from Anyone (Control Panel\Network and Internet\People Near Me)
d) From a computer connected to the same IPv6 subnet, select “Graph" then "Invite someone nearby” from the menu.
e) From the list of PNM endpoints on your subnet, select the endpoint of interest and send an invite.
f) On the target computer, view and accept the invite. The GraphChat sample will launch and automatically connect to the graph to which it was invited. The name of the graph is sent in the Invite as application specific data, which is then used by GraphChat when it launches.