socket_acc...onblocking(3)

πŸ’– socket_acc...onblocking(3) πŸ’–

okay bestie, welcome to the Library Functions Manual, we're doing a lil deep dive today ✨


πŸŽ€ NAME πŸŽ€

socket_accept6_makenonblocking β€” accept an IPv6 TCP connection on a socket πŸ¦‹


🌸 SYNTAX 🌸

#include <libowfat/socket.h>

int socket_accept6_makenonblocking(int s,char ip[16],uint16 *port,uint32
*scope_id);

✨ DESCRIPTION ✨

so like, this function is functionally equivalent to calling socket_accept4 and then calling ndelay_on on the socket you just got back. same energy, same result πŸ’…

BUT β€” and this is the slay part β€” it may save you a syscall or two, and in the process it avoids a race condition. so it's giving "same thing but smarter" 🌈 no cap.


🌟 EXAMPLE 🌟

here's the vibe, fr fr:

#include <libowfat/socket.h>

int s;
char ip[16];
uint16 port;
uint32 scope_id;

s = socket_tcp6();
socket_bind6(s,ip,port,scope_id);
socket_listen(s,16);
socket_accept6_makenonblocking(s,ip,&port,&scope_id);

look at her go πŸ˜­πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're iconic:


and that's the whole page bestie, we ate and left no crumbs πŸ“

and yeah, the footer said socket_acc...onblocking(3) and honestly? she's right, she ate too. same name, same page, same Library Functions Manual energy. mwah πŸ’œπŸ§š