The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Citrix::LaunchMesg - Generate Citrix session launch messages in format understood by Citrix Desktop Clients.

DESCRIPTION

Citrix::LaunchMesg Has methods for both initiating a totally new session and reconnecting to an existing session. Depends on Net::DNS to resolve server hostname to IP Address (convention used in Citrix launch messages).

For now please look into the file session_template.pl within module distro to learn about launch message sections used for constructing the launch message (by Citrix::LaunchMesg::new()).

SYNOPSIS

   use Citrix::LaunchMesg;
   # Get "all farms" configuration (as indexed hash)
   my $fms = Citrix::getfarms('idx' => 1);
   
   # Pick Farm to launch session on
   my $fc = $fms->{'istanbul'};
   # (Perl hash) default-valued Templates for launch message sections
   my %sections = ('client' => $client, 'app' => $app, );
   my $clm = Citrix::LaunchMesg->new($fc, %sections);
   # Launch a new session (by Domain, Username, CitrixApp)
   my $err = $clm->setbalanced('hypertechno', 'joecitrix', 'DESKTOP-UNIX');
   # Send "launch.ica" to web browser to be processed by wfcmgr Citrix desktop client app.
   # When set via HTTP in a web application Need to add respective http headers
   # within application. Use 'application/x-ica' to launch Citrix client helper app. 
   print $clm->output();
   
   
   # ... Connect to existing session (after Citrix::LaunchMesg->new(...))
   # You should do app level checks that this session actually belongs to user launching it.
   # However the Citrix authentication phase still prevents abuse.
   $clm->sethostappsess("good-old-host-22:3567");
   print $clm->output();

METHODS

my $clm = Citrix::LaunchMesg->new($farmctx, %opt);

Constructor for launch Message by Farm Context $farmctx, templates for various sections of Citrix Launch message. This may later serve for launching a truly new session or connecting to existing one. Options (%opt) are:

client - Client Config section
app - Application Config section
inputenc - Input Encoding (optional, default: 'InputEncoding' => 'ISO8859_1')

For an example / quick reference on above section see file 'session_template.pl' in source distribution.

$clm->setbalanced($dom, $uid, $capp);

Initialize message state for launching a new load-balanced session for user $uid in Citrix domain ($dom) by application name ($capp). Domain string usually looks like Windows domain name (e.g. company name without spaces). The launch message already contain Citrix Farm context (so does not need to be passed in here). Use output() later to generate the actual message. Returns 0 for success

$clm->sethostappsess($hostsess);

Initialize message state for connecting to an existing session by passing host / session ID info in $hostsess. $hostsess should be given in Citrix native notation "$host:$sessid". Queries Citrix Application ID live from current farm, since this is required in message. Use output() to generate the actual message Returns 0 for success

$clm->output();

Generate, format and output the 4 sections of a Citrix launch message. The sections internally accessed are 'client' (Citrix Client), 'app' (Citrix Application), 'appserv' (Citrix Application Server host). Return none