Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xpaclient(3) [debian man page]

xpaclient(3)							SAORD Documentation						      xpaclient(3)

NAME
XPAClient - The XPA Client-side Programming Interface SYNOPSIS
A description of the XPA client-side programming interface. DESCRIPTION
Introduction to XPA Client Programming Sending/receiving data to/from an XPA access point is easy: you generally only need to call the XPAGet() or XPASet() subroutines. #include <xpa.h> int XPAGet(XPA xpa, char *template, char *paramlist, char *mode, char **bufs, int *lens, char **names, char **messages, int n); int XPASet(XPA xpa, char *template, char *paramlist, char *mode, char *buf, int len, char **names, char **messages, int n); int XPAInfo(XPA xpa, char *template, char *paramlist, char *mode, char **names, char **messages, int n); int XPAAccess(XPA xpa, char *template, char *paramlist, char *mode, char **names, char **messages, int n); int XPAGetFd(XPA xpa, char *template, char *paramlist, char *mode, int *fds, char **names, char **messages, int n); int XPASetFd(XPA xpa, char *template, char *paramlist, char *mode, int fd, char **names, char **messages, int n); XPA XPAOpen(char *mode); void XPAClose(XPA xpa); int XPANSLookup(XPA xpa, char *template, char *type, char ***classes, char ***names, char ***methods, char ***infos); Introduction To use the XPA application programming interface, a software developer generally will include the xpa.h definitions file: #include <xpa.h> in the software module that defines or accesses an XPA access point and then will link against the libxpa.a library: gcc -o foo foo.c libxpa.a XPA has been compiled using both C and C++ compilers. Client communication with XPA public access points generally is accomplished using XPAGet() or XPASet() within a program (or xpaget and xpaset at the command line). Both routines require specification of the name of the access point. If a template is used to specify the access point name (e.g., "ds9*"), then communication will take place with all servers matching that template. SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpaclient(3)

Check Out this Related Man Page

xpaset(3)							SAORD Documentation							 xpaset(3)

NAME
XPASet - send data to one or more XPA servers SYNOPSIS
#include <xpa.h> int XPASet(XPA xpa, char *template, char *paramlist, char *mode, char *buf, int len, char **names, char **messages, int n); DESCRIPTION
Send data to one or more XPA servers whose class:name identifier matches the specified template. A template of the form "class1:name1" is sent to the XPA name server, which returns a list of at most n matching XPA 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 XPA struct is passed to the call, 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 XPASet() routine transfers data from buf to the XPA servers. The length of buf (in bytes) should be placed in the len variable. A string containing the class:name and ip:port of each of these 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. NB: if specified, the name and messages arrays must be of size n or greater. The returned message string will be of the form: XPA$ERROR [error] (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 NULL, no information is passed back in that particular array. The mode string is of the form: "key1=value1,key2=value2,..." The following keywords are recognized: key value default explanation ------ -------- -------- ----------- ack true/false true if false, don't wait for ack from server (after callback completes) verify true/false false send buf from XPASet[Fd] to stdout doxpa true/false true client processes xpa requests The ack keyword is useful in cases where one does not want to wait for the server to complete, e.g. if a lot of processing needs to be done by the server on the passed data or when the success of the server operation is not relevant to the client. Normally, an XPA client will process incoming XPA server requests while awaiting the completion of the client request. Setting this vari- able to "false" will prevent XPA server requests from being processed by the client. Example - #include <xpa.h> #define NXPA 10 int i, got; int len; char *buf; char *names[NXPA]; char *messages[NXPA]; ... [fill buf with data and set len to the length, in bytes, of the data] ... /* send data to all access points */ got = XPASet(NULL, "ds9", "fits", NULL, buf, len, names, messages, NXPA); /* error processing */ for(i=0; i<got; i++){ if( messages[i] ){ fprintf(stderr, "ERROR: %s (%s) ", messages[i], names[i]); } if( names[i] ) free(names[i]); if( messages[i] ) free(messages[i]); } SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpaset(3)
Man Page