About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/xpaaccess.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 xpaaccess Context: xpa

Synopsis

Find out how many XPA access points are available that match a given name.

Syntax

Integer_Type xpaaccess( String_Type dest )
Integer_Type xpaaccess( String_Type dest, String_Type accessmode )

Description

This function returns 0, 1, or more to indicate how many instances of the given XPA application server(s) are currently running. The optional accessmode argument lists the type of access requested, which can be any combination of g, s, and i for get, set, and info access. See the XPA documentation for more information, in particluar the description of the xpaaccess command-line tool from the XPA distribution.

Example 1

chips> require( "xpa" )
chips> xpaaccess( "prism" )
1

The xpaaccess() call tells us that there is one XPA server running called "prism".

Example 2

chips> !prism &
chips> !prism -xpa bob &
chips> xpaaccess( "prism" )
1
chips> xpaaccess( "prism*" )
2
chips> xpaaccess( "bob" )
1

We start two new prism processes: the XPA access points for these will be called "prism2" (assuming the original prism is still running) and "bob". See "ahelp prism" and "ahelp session" for further information on how the access points are named. The xpaaccess() calls tell us there is one server that matches "prism" (this is the original prism), two that match "prism*" (the "*" acts as a wild card and so selects "prism" and "prism2" here), and one that matches "bob".

Example 3

The following code shows how you can use this function in a S-Lang program (see "ahelp slsh" for more information on running S-Lang programs). When run with an argument the program will tell you how many servers whose name matches that of the argument.

  #!/usr/bin/env slsh
  if ( 2 != __argc )
    usage( __argv[0] + " name" );

  require("xpa");
  variable nmatch = xpaaccess( __argv[1] + "*" );
  vmessage(
    "There are %d XPA servers that begin with '%s'", nmatch, __argv[1]
  );
Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.