4 Protocol Examples

The following scenario shows a successful real-time connection established between two peers, Peer A and Peer B. The example demonstrates this through a hypothetical application called Adventure Works, made by Contoso. This example assumes that the underlying transport works like Near Field Communication (NFC), in that the transport is activated when two peers become proximate. Peer A has the NfpService (section 3.1.1.1) initialized with an active Session Factory object (section 3.1.1.3) that is configured to establish a session when the transport is next activated. Peer A is running on a platform called "Windows". Peer B merely has the NfpService initialized, and it is running on a platform called "Android".

Peer A's NfpService happens to have a SourceID = 0x80, 0x29, 0x84, 0xF4, 0xD6, 0x0E, 0x8D, 0x2B. The base64 encoding for this SourceID is "gCmE9NYOjSs".

Peer B's NfpService happens to have a SourceID = 0xF3, 0x88, 0xC0, 0x6B, 0xE9, 0xCF, 0xD4, 0xDE. The base64 encoding for this SourceID is "84jAa+nP1N4".

In this example, the application is uniquely identified on each platform by the following IDs:

  • "Android" – "Contoso-Adventure Works-3/6/2012"

  • "Windows" – "Contoso%AdventureWorksApp"

  • "WinPhone" – "{8342DF32-AD41-8993-927F-CACE4A295751}

Initially, Peer A's Session Factory object has the following abstract data model elements:

SessionList:  Empty, no Session objects (section 3.1.1.4) that represent connections to Peer B.

AppID:  "Windows" – "Contoso%AdventureWorksApp"

AlternateIDList:  "Android" – "Contoso-Adventure Works-3/6/2012", "WinPhone" – "{8342DF32-AD41-8993-927F-CACE4A295751}

Launch:  TRUE.

SessionFactoryID:  0x6c331689, c15ca44b. This number is specified as random. However, for this example, this number was specifically chosen to make it easy to recognize.

TcpPort:  55555.

RfcommPort:  5.

ReferenceCount:  1 (referenced by the running Adventure Works app).