Skip to content

The Collaboration Broker Client API Example

The included sample Collaboration Broker Client demonstrates how the APIs can be used to customize and control the pre-session and session phases of the Collaboration connection. The Collaboration Broker Client API is a two-step procedure, where as a first step, the Collaboration Broker Client Example is built. The second step consists of running a prebuilt Collaboration binary.

More About the Collaboration Broker Client

The Collaboration Broker Client Example extends on the Broker Client Example demonstrate how the Broker Client can join a collaboration session.

Code is an API Demonstration Only

The sample session client, described in the following sections, demonstrates a simple connection scenario using the supplied broker_client_library. The example unrealistically assumes that all requests and calls succeed as expected, and performs only basic error handling. An actual client implementation is likely to be far more complex; for example, you will need to handle failed broker certificate verification, account for other authentication steps beyond a simple user ID and password combination, and any other circumstances dictated by your system requirements.

Building the Broker Client Example

Detailed Instructions

For more information on building the Broker client example, see Building the Linux SDK.

  1. Install the latest PCoIP Software Client. For more information see the topic "Installing the PCoIP Software Client for Linux" in the Administrators Guide.
  2. Download the latest Linux SDK.
  3. To install the SDK, extract the contents of the PCoIPSoftClientSDK folder to a location of your preference.
  4. From the PCoIPSoftClientSDK folder, use the cd command to change the directory to broker_client_example.
  5. Create a build directory by running the following command: mkdir build
  6. Change the directory to build by running the following command: cd build
  7. Configure the SDK example by running the following command: cmake -G Xcode ..
  8. Build the example by running the following command: cmake --build . --config RelWithDebInfo

Custom Broker Client Library Implementations

This procedure creates broker_client_example.app and broker_client_example_aws.app in the RelWithDebInfo folder, making the following executables available:

  • ./RelWithDebInfo/broker_client_example.app/Contents/MacOS/broker_client_example
  • ./RelWithDebInfo/broker_client_example_aws.app/Contents/MacOS/broker_client_example_aws

Running the Prebuilt Collaboration Example Binary

This topics contains instructions for running the Collaboration example binary that is packaged along with the Client SDK. The example uses credentials provided by the primary session owner to first establish a PCoIP session and then launch the PCoIP Software Client as a collaborator. The PCoIP Software Client thus launched, then connects to the remote agent.

Location of the login_info_collaborator File

The login_info_collaborator.txt file is available in the following location: /PCoIPSoftClientSDK/Examples/broker_client_example/bin

  1. From the broker_client_example folder, open the login_info_collaborator.txt file.
  2. Add the collaborator session details in the format "invite_URI collaborator_name invite_code", where,
  • `invite_uri`: The collaboration invitation URI provided by the primary session owner.
  • `collaborator_name': The name of the collaborator.
  • `invite_code`: The invitation code provided by the primary session owner.

Example:

 pcoip://10.11.12.13/connect?data=eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTY3MDYwMTQ1MSwiaWF0IjoxNjcwNjAxNDUxfQ.z8w07IcV5eYbqbYGdjscMVSWFUB4tbU9WrV_V4GWyDU collaborator 123435
  1. Launch the example from a Terminal session:
        cd ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin/broker_client_example_collaborator.app/Contents/MacOS
    
        killall PCoIPClient
    
        ./broker_client_example_collaborator -l -i ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin/login_info_collaborator.txt