IXP_SERVERLOOP(3)
π
IXP_SERVERLOOP β bestie, it's the ixp_serverloop(3) page π
okay so real talk, this is ixp_serverloop and IxpServer from the ixp.h header, straight outta the libixp manual. sit down, grab a strawberry π, we're gonna get into it.
β¨ SYNOPSIS β¨
like, here's the whole vibe, no cap:
#include <ixp.h>
int ixp_serverloop(IxpServer *srv);
typedef struct IxpServer IxpServer;
struct IxpServer {
IxpConn* conn;
IxpMutex lk;
IxpTimer* timer;
void (*preselect)(IxpServer*);
void* aux;
int running;
int maxfd;
fd_set rd;
}
look at that struct. it's giving main character energy, honestly π. every field exactly where it belongs β conn, lk, timer, that preselect function pointer, aux, running, maxfd, and the rd file descriptor set. iconic. periodt.
πΈ DESCRIPTION πΈ
so ixp_serverloop() is literally the main loop of the server β you call it and it justβ¦ enters. that's it. that's the vibe. it lives there β¨.
the way it works is it keeps going until one of two things happens:
srv->runningbecomes false β bestie said "we're done here" πselect(2)comes back with an error that is notEINTRβ like,EINTRis fine, that's just a little interruption, we forgive it, we keep going π«Ά. anything else? that's a wrap.
ngl,EINTRis the only error we're chill about. every otherselect(2)error ends the whole loop. so likeβ¦ handle your business π
π¦ RETURN VALUE π¦
0β the loop exited normally. slay. everything's fine π1β the loop exited on error. not slay. go check what happened π₯
and if you need the deets on what went wrong, you can inspect errno(3), or look at the return value of ixp_errbuf(3). iykyk π
π SEE ALSO π
ixp_listen(3)β go read it, bestie πixp_settimer(3)β also go read it, fr fr β
that's the whole page, angel π. libixp Manual, dated 2012 Dec β yes, she's an elder millennial manually, but the energy is forever young. go forth and ixp_serverloop() responsibly π§ββοΈπ
π¦ where this page comes from
- nixos 26.05: libixp 0-unstable-2022-04-04
- nixpkgs unstable: libixp 0-unstable-2022-04-04
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms