qlibs:(timeoutconn)

πŸ“¦ version 31, in alpine 3.24

πŸ¦‹ timeoutconn πŸ¦‹

bestie, welcome to the manual page from qlibs:(timeoutconn) β€” manual name folded in near the top, exactly like we're supposed to. It's giving "tiny but mighty C networking helper" energy, and we're keeping every detail, no cap πŸ’…βœ¨

✨ NAME ✨

timeoutconn β€” set up an outoing stream socket for IPv4/IPv6. Yes, the page really spells it outoing, and we are not fixing it, periodt πŸ˜­πŸ’–

🌸 SYNTAX 🌸

Here's the exact include and the three function signatures, character for character:

#include "timeoutconn.h"

int timeoutconn4(int s,char ip[4],uint16 p,unsigned int t);
int timeoutconn6(int s,char ip[16],uint16 p,unsigned int t,uint32 netif);
int timeoutconn(int s,char ip[16],uint16 p,unsigned int t,uint32 netif);

🌈 DESCRITPION 🌈

(That's the section spelling on the page β€” we're keeping it, bestie 🫢)

timeoutconn tries to establish a TCP stream socket to address ip on remoteport p and waiting for t seconds, and on success returns the s socket identifier. Slay.

In case addresss is an IPv6 LLU address, one needs to define the netif interface index, otherwise 0 is the default. Little netif main-character moment, iykyk πŸ’œ

πŸ”₯ INTERNALS πŸ”₯

timeoutconn depends on taia and iopuase to determine the timespan and perhaps ndelay to succeed. That's the whole internal tea, fr fr πŸ“

πŸ’– RETURN CODES πŸ’–

timeoutconn returns 0 if the connection is established and -1 if an error has occured. (Yep, occured is spelled like that on the page β€” preserving the lore πŸ’€)

🌟 SEE ALSO 🌟

Go read these, bestie: socket_if(3), timeout(3) taia(3), wait(3) ✨


okay bestie, that's the whole page πŸŽ€ the footer says section 3 and qlibs:(timeoutconn), and there's no date listed β€” so here's your cute sign-off instead: source/manual qlibs:(timeoutconn), section 3, date: not today 😭🫢🌈✨

πŸ“¦ where this page comes from