The Broker Client API Example¶
The included sample broker client demonstrates how the APIs can be used to customize and control the pre-session and session phases of the connection.
Finding the Latest Information
While we make every attempt to keep this topic current, the README.md file available as a part of the Broker Client example contains the latest information .
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.
The Broker Client API Example Sequence¶
This section describes how the Broker Client API example implements the PCoIP session sequence. It also provides an overview of invoking and using the executable session client.
Custom Broker Client Library Implementations
PCoIP clients interact with PCoIP-compatible brokers and PCoIP agents using an abstraction layer called a broker client library. The following example uses the supplied broker client library. You may, however, choose to write your own broker client library to meet specific requirements, or use a thirdparty broker library which does not use the PCoIP Broker Protocol. Refer to the PCoIP® Connection Broker Protocol Specification for details on how to design and implement your own connection broker.
Building the Broker Client Example from src Folder¶
- From the
root
folder insidePCoIPSoftClientSDK
, use thecd
command to change directory to thesrc
folder of the Broker Client example:cd ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/src
- Create a build directory by running the following command:
mkdir build && cd build
- Configure the SDK example by running the following
cmake
command:cmake -G Xcode ..
- Build by running the following
cmake
command:cmake --build . --config RelWithDebInfo
Custom Broker Client Library Implementations
This creates broker_client_example.app
and broker_client_example_aws.app
in the RelWithDebInfo
folder. The executables to run from the current folder are:
- ./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 PCoIP Client Binary¶
This example uses the supplied credentials to first establish a PCoIP session and then launch the PCoIP Software Client. The PCoIP Software Client thus launched, then connects to the remote agent.
Location of the login_info File
The login_info.txt
file can be found in the following location: ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin
- Install the latest PCoIP Software Client.. For more information see the topic "Installing the PCoIP Software Client for macOS" in the Administrators Guide.
- Download the latest MacOS SDK.
- To install the SDK, open the
.dmg
file, and drag thePCoIPSoftClientSDK
folder to your Documents folder (or another location of your preference). - Open the
login_info.txt
file. -
Add the remote PCoIP agent credentials in the format "FQDN domain username password hostname", where,
-
FQDN
: Address of an HP Anyware broker. domain
: Domain that the host machine is on.username
: The username of the account you're connecting with.password
: Plain text password. Cannot contain spaces.hostname
: The name of the HP Anyware Agent machine.
Example:
desktop.example.com adomain.local foouser barpassword bazmacpro01
- Launch the example from a Terminal session:
cd ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin/broker_client_example.app/Contents/MacOS killall PCoIPClient ./broker_client_example -l -i ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin/login_info.txt
Running the prebuilt AWS example binary¶
This example uses the supplied credentials to first establish a PCoIP session and then launch the PCoIP Software Client. The PCoIP Software Client thus launched, then connects to the remote agent.
Location of the login_info_aws File
The login_info_aws.txt
file can be found in the following location: ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin
- Install the latest PCoIP Software Client.. For more information see topic "Installing the PCoIP Software Client for macOS" in the Administrators Guide.
- Download the latest MacOS SDK.
- To install the SDK, open the
.dmg
file, and drag thePCoIPSoftClientSDK
folder to your Documents folder (or another location of your preference). - Open the
login_info_aws.txt
file. -
Add the remote Amazon WorkSpace credentials in the format "aws_registration_code domain username password token_or_password resource_name", where,
-
aws_registration_code
: Registration code for Amazon WorkSpace. domain
: Domain that the host machine is on.username
: The username of the account you're connecting with.password
: Plain text password. Cannot contain spaces.token_or_password
: Authentication token or password.resource_name
: Name of the resource to connect to.
Example:
eNgrTX$xa adomain.local foouser barpassword 75539285075371469148082720109113041434163396974558736008282251461494906419802726 aws57864x1
- Launch the example from a Terminal session:
cd ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin/broker_client_example_aws.app/Contents/MacOS killall PCoIPClient ./broker_client_example_aws -l -i ~/Documents/PCoIPSoftClientSDK/Examples/broker_client_example/bin/login_info_aws.txt