3.1 Peer Details
This section defines peer roles in the Connected Devices Platform V3 Service Protocol.
In a socket-based connection between two peer applications, one peer has the role of client, and the other peer has the role of host. The roles are distinguished as follows:
The device that performs discovery (and initiates connection) is the client. For UDP, this device sends the Presence Request message as well as the Connection Request message. For BLE, this device scans for beacons.
The host is the peer that is discovered (and is the connection target). For UDP, this device receives the Presence Request message and sends back a Presence Response message. It also receives the Connection Request message and responds. For BLE, this is the device that advertises its beacon.
During a connection, these two devices communicate by sending messages back and forth and requesting/requiring Ack messages when necessary. All messages during a connection are contained in Session Messages.