pcoip_connect_desktop

Connects to the remote desktop using its identifier.

C Language

int pcoip_connect_desktop(const char* desktop_id);

ExampleTeradici PCoIP Protocol Functions

Arguments

NameComments
desktop_idThe ID of the remote desktop.

General

pcoip_connect_desktop connects to the remote desktop using the desktop ID, in contrast to pcoip_connect which needs the IP address and port of the remote desktop.

Before calling pcoip_connect_desktop, set the credentials with pcoip_set_auth.

Return Values

E_OK 
E_ALREADY_CONNECTEDDo not call this function after the connection is established.
E_NOT_CONNECTEDAction cannot be performed. There is no connection to the remote server.
E_OUT_OF_TIMEFunction timed out.
E_ILLEGAL_PARAMETERIllegal parameter found.
E_INTERNALInternal error found.

Parameterization

The desktop_id argument can be parameterized.

Example

This example shows a connection and disconnection.

int nIteration = 0;

char* sIteration = lr_eval_string("{IterNum}");
    
if(sIteration != NULL)
	nIteration = atoi(sIteration); 

pcoip_set_broker_address("broker.pcoip.com", "443");

pcoip_set_auth("johndoe", "my_domain", lr_unmask("12a3456789b009cde87ffedc"));

// Connect remote desktop using its DesktopID each even iteration,
// and using its IP address/port each odd iteration
if( (nIteration % 2) == 0 )
	pcoip_connect_desktop("cn=desktops,ou=apps,dc=vdi,dc=vmware,dc=int");
else 
	pcoip_connect("10.10.14.22", "10.10.14.22", "", "4172");
    
pcoip_set_display(800, 600);
    
lr_think_time(5); 
pcoip_mouse_click(626, 13, LEFT_BUTTON, 0, "snapshot2");

pcoip_disconnect();