SYNOPSIS

  #include <xpa.h>

  int XPAInfo(XPA xpa,
              char *template, char *paramlist, char *mode,
              char **names, char **messages, int n);

DESCRIPTION

Send a short paramlist message to one or more \s-1XPA\s0 servers whose class:name identifier matches the specified template.

A template of the form \*(L"class1:name1\*(R" is sent to the \s-1XPA\s0 name server, which returns a list of at most n matching \s-1XPA\s0 servers. A connection is established with each of these servers and the paramlist string is passed to the server as the data transfer request is initiated. If an \s-1XPA\s0 struct is passed to the call, then the persistent connections are updated as described above. Otherwise, temporary connections are made to the servers (which will be closed when the call completes).

The XPAInfo() routine does not send data from a buf to the \s-1XPA\s0 servers. Only the paramlist is sent. The semantics of the paramlist is not formalized, but at a minimum is should tell the server how to get more information. For example, it might contain the class:name of the \s-1XPA\s0 access point from which the server (acting as a client) can obtain more info using XPAGet.

A string containing the class:name and ip:port of each server is returned in the name array. If a given server returned an error or the server callback sends a message back to the client, then the message will be stored in the associated element of the messages array. The returned message string will be of the form:

XPA$ERROR error\-message (class:name ip:port)

or

XPA$MESSAGE message (class:name ip:port)

The return value will contain the actual number of servers that were processed. This value thus will hold the number of valid entries in the names and messages arrays, and can be used to loop through these arrays. In names and/or messages is \s-1NULL\s0, no information is passed back in that array.

The following keywords are recognized:

key value default explanation ------ -------- -------- ----------- ack true/false true if false, don't wait for ack from server

When ack is false, XPAInfo() will not wait for an error return from the \s-1XPA\s0 server. This means, in effect, that XPAInfo will send its paramlist string to the \s-1XPA\s0 server and then exit: no information will be sent from the server to the client. This UDP-like behavior is essential to avoid race conditions in cases where \s-1XPA\s0 servers are sending info messages to other servers. If two servers try to send each other an info message at the same time and then wait for an ack, a race condition will result and one or both will time out.

Example -

(void)XPAInfo(NULL, "IMAGE", "ds9 image", NULL, NULL, NULL, 0);

RELATED TO xpainfo…

See xpa(7) for a list of \s-1XPA\s0 help pages