xpaset.3 | xpaset.3 | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
matches the specified template. | matches the specified template. | |||
A template of the form "class1:name1" is sent to the XPA name server , | 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 connectio n | which returns a list of at most n matching XPA servers. A connectio n | |||
is established with each of these servers and the paramlist string i s | is established with each of these servers and the paramlist string i s | |||
passed to the server as the data transfer request is initiated. If a n | passed to the server as the data transfer request is initiated. If a n | |||
XPA struct is passed to the call, the persistent connections are | XPA struct is passed to the call, the persistent connections are | |||
updated as described above. Otherwise, temporary connections are mad e | updated as described above. Otherwise, temporary connections are mad e | |||
to the servers (which will be closed when the call completes). | to the servers (which will be closed when the call completes). | |||
The XPASet() routine then transfers data in buf to the XPA servers. | The XPASet() routine transfers data from buf to the XPA servers. Th | |||
(The length of the buffer is known from the len variable.) A string | e | |||
containing the class:name and ip:port of each of these server is | length of buf (in bytes) should be placed in the len variable. | |||
returned in the name array. If a given server returned an error or | ||||
the | A string containing the class:name and ip:port of each of these serv | |||
server callback sends a message back to the client, then the message | er | |||
will be stored in the associated element of the messages array. The | is returned in the name array. If a given server returned an error | |||
returned message string will be of the form: | or | |||
the server callback sends a message back to the client, then the mes | ||||
‐ | ||||
sage will be stored in the associated element of the messages array. | ||||
The returned message string will be of the form: | ||||
XPA$ERROR [error] (class:name ip:port) | XPA$ERROR [error] (class:name ip:port) | |||
or | or | |||
XPA$MESSAGE [message] (class:name ip:port) | XPA$MESSAGE [message] (class:name ip:port) | |||
The return value will contain the actual number of servers that were | The return value will contain the actual number of servers that were | |||
processed. This value thus will hold the number of valid entries in | 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 | 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 | arrays. In names and/or messages is NULL, no information is passed | |||
back in that particular array. | back in that particular array. | |||
The mode string is of the form: "key1=value1,key2=value2,..." The f ol‐ | The mode string is of the form: "key1=value1,key2=value2,..." The f ol‐ | |||
lowing keywords are recognized: | lowing keywords are recognized: | |||
key value default explanation | key value default explanation | |||
------ -------- -------- ----------- | ------ -------- -------- ----------- | |||
ack true/false true if false, don't wait for ack from server (after callback completes) | 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 | 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 f or | The ack keyword is useful in cases where one does not want to wait f or | |||
the server to complete, e.g. if a lot of processing needs to be done by | 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 oper a‐ | the server on the passed data or when the success of the server oper a‐ | |||
tion is not relevant to the client. | tion is not relevant to the client. | |||
Normally, an XPA client will process incoming XPA server requests wh | ||||
ile | ||||
awaiting the completion of the client request. Setting this variabl | ||||
e | ||||
to "false" will prevent XPA server requests from being processed by | ||||
the | ||||
client. | ||||
Example: | Example: | |||
#include <xpa.h> | #include <xpa.h> | |||
#define NXPA 10 | #define NXPA 10 | |||
int i, got; | int i, got; | |||
int len; | int len; | |||
char *buf; | char *buf; | |||
char *names[NXPA]; | char *names[NXPA]; | |||
char *messages[NXPA]; | char *messages[NXPA]; | |||
... | ||||
[fill buf with data and set len to the length, in bytes, of the da | ||||
ta] | ||||
... | ||||
/* send data to all access points */ | ||||
got = XPASet(NULL, "ds9", "fits", NULL, buf, len, names, messages, NXPA); | got = XPASet(NULL, "ds9", "fits", NULL, buf, len, names, messages, NXPA); | |||
/* error processing */ | ||||
for(i=0; i<got; i++){ | for(i=0; i<got; i++){ | |||
if( messages[i] != NULL ){ | if( messages[i] ){ | |||
/* error processing */ | ||||
fprintf(stderr, "ERROR: %s (%s)\n", messages[i], names[i]); | fprintf(stderr, "ERROR: %s (%s)\n", messages[i], names[i]); | |||
} | } | |||
if( names[i] ) | if( names[i] ) free(names[i]); | |||
free(names[i]); | if( messages[i] ) free(messages[i]); | |||
if( messages[i] ) | ||||
free(messages[i]); | ||||
} | } | |||
SEE ALSO | SEE ALSO | |||
See xpa(n) for a list of XPA help pages | See xpa(n) for a list of XPA help pages | |||
version 2.1.6 May 2, 2005 xpaset (3) | version 2.1.8 November 1, 2007 xpaset (3) | |||
End of changes. 8 change blocks. | ||||
14 lines changed or deleted | 30 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |