Group Chat (XP) Sample

The Group Chat (XP) Sample Application demonstrates how to create a chat application based on the Peer-to-Peer Grouping and Identity Manager API.  It shows a secure multiparty chat application into which you can authenticate people using certificates.

 

Platforms supported

·         Windows XP SP2

·         Windows XP SP3

 

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 groupchat.exe from ...\PeerToPeer\GroupChat\XP\XP32_DEBUG\

·         Just use the UI! To establish and exchange certificates the following steps must be followed:

    1. Creating a Peer Identity for each user
      In the Group Chat sample, a user can generate an identity by selecting the "Create…" option on the "Identity" menu.  The resulting dialog box prompts the user for the friendly name (in this case, the "chat name") that will be associated with the new identity.  Before a group can be created, an identity associated with the group creator needs to be created.

    2. Creating a group that will host the chat participants
      Once the group owner has an identity, a group is created by selecting the "Create…" option on the "Group" menu. The resulting dialog prompts the user for the identity of the group creator, as well as the name of the group to be created. The newly created graph will be associated with the chosen identity. 

    3. Creating participants’ identity information files for invitations
      Once the chat group has been created, chat members can solicit the group owner for invitations to join the group. An invitation consists of an XML data string derived from a unique identity (as created in step 1).  An invitation is thus exclusively bound to a particular identity.  The group owner uses the Peer-to-Peer Grouping API to generate an invitation from an identity and then returns this invitation to the user requesting permission to join the group.

      Users that wish to join the chat group create user identities the same way that the group owner identity is created, using the "Create…" option on "Identity" menu. The "Identity" menu also allows the user to save this identity information to a file.  This file is then sent out of band of the Peer-to-Peer infrastructure to the group owner, who creates the corresponding invitation.

    4. Creating the invitations to join the group to chat
      When the group owner receives a file containing a user’s identity information, they can create a file containing an invitation to join the group using the "Create Invitation…" item on the "Group" menu. Selecting this option opens the Create Invitation dialog and prompts the user to specify the location of the identity information (.idt) file, as well as the destination of the invitation information (.inv) file.  The invitation file is then sent out of band of the Peer-to-Peer infrastructure to the requesting individual.

      It is important to note that invitations created with the Group Chat application demonstrate how to create invitations for the "Member" role.  A group participant with a member role cannot issue invitations.  Only participants with "Admin" credentials can create invitations.

    5. Joining the Chat Group
      In order to join the chat group, a user needs to have a predefined identity as well as the invitation file that corresponds to that identity.  If these two requirements are satisfied, the "Join…" option on the "Group" menu can be used to join the group. Selecting this option opens the Join Group dialog, which requires the user to select his identity and location of the invitation (.inv) file. Pressing the "OK" button initiates the join process.  If this is successful, the chat application will connect to the group and the chat user will be online.

    6. Whispering to other members
      To carry on a private conversation with another member, simply double-click that member in the 'Chat Members' list.  The "Whisper" dialog will allow the user to send a private message to the selected member.


Troubleshooting Tips:
  1. Make sure that PNRP V2 is installed. Follow the instructions on Update for Windows XP (KB920342)

  2. To test that the Peer Name Resolution Protocol works refer to the MSDN P2P Blog for the PNRP Debugging Guide Part 1