xpaaccess(3)
π XPAAccess π
okay bestie, listen β this is the xpaaccess(3) page from the SAORD Documentation set, and it's literally the glow-up era of XPA: this routine needs XPA 2.1 and above. no cap. let's get into it π«Ά
β¨ NAME β¨
XPAAccess β return XPA access points matching a template (XPA 2.1 and above) π
β¨ SYNOPSIS β¨
#include <xpa.h>
int XPAAccess(XPA xpa,
char *template, char *paramlist, char *mode,
char **names, char **messages, int n);
β¨ DESCRIPTION β¨
so the XPAAccess routine returns the public access points that match the template you hand it as that second argument, and that have the access type you asked for. two-for-two, we love to see it πΈ
A template shaped like "class1:name1" gets sent to the XPA name server, and the name server sends back a list of at most n matching XPA servers. then a connection gets established with each one of those servers, and the paramlist string gets passed along to the server right as the data transfer request kicks off. If an XPA struct is passed to the call, then the persistent connections get updated, exactly like described above. If not? then you're getting temporary connections to the servers instead, and those get closed the moment the call completes. short-lived king energy π
The XPAAccess() routine retrieves names from at most n XPA servers that match the specified template and that were checked for access using the specified mode. The return string contains both the class:name and the ip:port. If a given server returned an error, or the server callback sends a message back to the client, then that message gets stored in the associated element of the messages array. NB: if specified, the names and messages arrays have to be of size n or greater. like, that's not a suggestion bestie, that's the rule π
The returned message string will look like:
XPA$ERROR error-message (class:name ip:port)
β οΈ okay this part is important, don't scroll past it: names of matching registered access points are always returned, but they may not be valid. it is not sufficient to assume that the returned number of access points is the number of valid access points. Instead, it is essential to check themessagesarray for error messages. Any string in themessagesarray is an error message, and it indicates that the associated access point is not available. vibe check the messages array, fr fr π
For example β imagine a server registers a whole bunch of access points but delays entering its event loop. If a call to XPAAccess() happens before the event loop is entered, the call will time out (after waiting for the long timeout period) and return an error shaped like:
XPA$ERROR: timeout waiting for server authentication (XPA:xpa1)
That error means the XPA access point has been registered but is not yet available, because events aren't being processed. Once the server finally enters its event loop, subsequent calls to XPAAccess() will return successfully. it was just in its getting-ready era, give it a sec π§
NB: this routine only works with XPA servers built with XPA 2.1.x and later. Servers running older versions of XPA will return this error message:
XPA$ERROR invalid xpa command in initialization string
and if you get that error message? plot twist: the old server actually is ready for access, because it got all the way to the point of fielding the query! The xpaaccess program, for example, ignores this message in order to work properly with older servers. iconic behavior honestly π
The third argument for XPAAccess() is the type of access, and it can be any combination of:
gβxpagetcalls can be made on this access pointsβxpasetcalls can be made on this access pointiβxpainfocalls can be made on this access point
The mode string argument is shaped like: "key1=value1,key2=value2,..."
The following keywords are recognized:
ackβ value:true/false, default:true, explanation: if false, don't wait for ack from server (after callback completes)
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). lowkey a filler episode but we respect it β¨
β¨ SEE ALSO β¨
See xpa(n) for a list of XPA help pages π
and that's the whole page, bestie! π this was version 2.1.15, dated July 23, 2013, filed under xpaaccess(3) from the SAORD Documentation collection. slay, go check your messages array, and stay hydrated ππ¦π
π¦ where this page comes from
- debian bookworm: libxpa-dev 2.1.20-1 Β· MIT
- debian trixie: libxpa-dev 2.1.20-3 Β· MIT
- ubuntu jammy: libxpa-dev 2.1.20-1 Β· MIT
- ubuntu noble: libxpa-dev 2.1.20-1build1 Β· MIT
- ubuntu questing: libxpa-dev 2.1.20-3
- ubuntu resolute: libxpa-dev 2.1.20-3build1 Β· MIT
- ubuntu stonking: libxpa-dev 2.1.20-3build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms