Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xpaopen(3) [debian man page]

xpaopen(3)							SAORD Documentation							xpaopen(3)

NAME
XPAOpen - allocate a persistent client handle SYNOPSIS
#include <xpa.h> XPA XPAOpen(char *mode); DESCRIPTION
XPAOpen() allocates a persistent XPA struct that can be used with calls to XPAGet(), XPASet(), XPAInfo(), XPAGetFd(), and XPASetFd(). Per- sistence means that a connection to an XPA server is not closed when one of the above calls is completed but will be re-used on successive calls. Using XPAOpen() therefore saves the time it takes to connect to a server, which could be significant with slow connections or if there will be a large number of exchanges with a given access point. The mode argument currently is ignored ("reserved for future use"). An XPA struct is returned if XPAOpen() was successful; otherwise NULL is returned. This returned struct can be passed as the first argument to XPAGet(), etc. Those calls will update the list of active XPA connections. Already connected servers (from a previous call) are left connected and new servers also will be connected. Old servers (from a previous call) that are no longer needed are disconnected. The con- nected servers will remain connected when the next call to XPAGet() is made and connections are once again updated. Example - #include <xpa.h> XPA xpa; xpa = XPAOpen(NULL); SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpaopen(3)

Check Out this Related Man Page

xpaget(3)							SAORD Documentation							 xpaget(3)

NAME
XPAGet - retrieve data from one or more XPA servers SYNOPSIS
#include <xpa.h> int XPAGet(XPA xpa, char *template, char *paramlist, char *mode, char **bufs, int *lens, char **names, char **messages, int n); DESCRIPTION
Retrieve data from 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, 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 XPAGet() routine then retrieves data from at most n XPA servers, places these data into n allocated buffers and places the buffer pointers in the bufs array. The length of each buffer is stored in the lens array. A string containing the class:name and ip:port is stored 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-message (class:name ip:port) or XPA$MESSAGE message (class:name ip:port) Note that when there is an error stored in an messages entry, the corresponding bufs and lens entry may or may not be NULL and 0 (respec- tively), depending on the particularities of the server. 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 bufs, lens, 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 array. The bufs, names, and messages arrays should be freed upon completion (if they are not NULL); 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) doxpa true/false true client processes xpa requests The ack keyword is not very useful, since the server completes the callback in order to return the data anyway. It is here for completion (and perhaps for future usefulness). 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 lens[NXPA]; char *bufs[NXPA]; char *names[NXPA]; char *messages[NXPA]; got = XPAGet(NULL, "ds9", "file", NULL, bufs, lens, names, messages, NXPA); for(i=0; i<got; i++){ if( messages[i] == NULL ){ /* process buf contents */ ProcessImage(bufs[i], ...); free(bufs[i]); } else{ /* error processing */ 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 xpaget(3)
Man Page