Skip to content

The Collaboration Broker Client 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 to 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

!!! Note "Custom Broker Client Library Implementations" After you complete step 6, the build/ directory will contain the built examples as .exe files, which you can launch from the command line or double click, depending on what you have built.

  1. Install the latest PCoIP Software Client. For more information see the topic "Installing the PCoIP Software Client for Windows" in the Administrators Guide.
  2. Download the latest Windows 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 directory called build/ inside the broker_client_example folder by running the following command: mkdir build
  6. Change the directory to build/ by using the cd command.
  7. Configure the SDK example by running the following command: cmake -G Xcode ..
  8. Build the example by running the following command: cmake --build
  9. Ensure that the CMakeLists.txt file present inside the directory has the path to the SDK directory appended to CMAKE_PREFIX_PATH so that the installed version of cmake on the system is able to locate the cmake modules for finding the dependencies:

   list(APPEND CMAKE_PREFIX_PATH "localpath/to/sdk/")

   find_package(PCoIPSoftClientSDK REQUIRED)
10. Link your application to the core library using the CMake command:

target_link_libraries(your_application PRIVATE PCoIPSoftClientSDK:pcoip_core)

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.

  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