GENSIO_ACC_SET_ACCEPT_CALLBACK_ENABLE_S(3)

πŸ“¦
version 3.0.4 Β· 2 versions
  • 3.0.4 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.3.5 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ gensio_acc_set_accept_callback_enable πŸ’–

okay bestie, welcome to gensio_acc_set_accept_callback_enable(3) β€” it's a Library Functions Manual page, and it's literally about the accept callback, so if you're out here accepting connections you're gonna wanna read this. no skipping 🫢


🌸 NAME 🌸

gensio_acc_set_accept_callback_enable, gensio_acc_set_accept_callback_enable_cb, gensio_acc_set_accept_callback_enable_s β€” Enable or disable the accept ready callback ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <gensio/gensio.h>

void gensio_acc_set_accept_callback_enable(
                    struct gensio_accepter *accepter,
                    bool enabled);

int gensio_acc_set_accept_callback_enable_cb(
                    struct gensio_accepter *accepter,
                                 bool enabled,
                                 gensio_acc_done done,
                                 void *done_data);

int gensio_acc_set_accept_callback_enable_s(
                    struct gensio_accepter *accepter,
                                 bool enabled);

πŸ’… DESCRIPTION πŸ’…

so these three functions are your little on/off switch for the accept callback, like when connections come in. enable/disable the accept callback when connections come in, that's the whole vibe. πŸ‘‘

gensio_acc_set_accept_callback_enable β€” this one does an asynchronous disable. and like, heads up bestie: this can race with pending and running callbacks, so you must be prepared to handle these races. no cap, it's just how it is. 😭

gensio_acc_set_accept_callback_enable_cb β€” same energy as the one above, except it does a callback when the enable is complete. it's really only useful for disable, because when the done callback fires, that means no more accepts will be called and all callbacks are done. and listen: if you call this, you cannot do another enable/disable until done is called. periodt. πŸ’…

gensio_acc_set_accept_callback_enable_s β€” like above, but a synchronous call. see the notes on gensio_open_s() for the dangers of using this function. yes, dangers. go read them. πŸ™ˆ


⭐ RETURN VALUES ⭐

Zero is returned on success, or a gensio error on failure. that's it, that's the whole thing. slay. ✨


πŸ¦‹ SEE ALSO πŸ¦‹


🌈 and that's the page, bestie! go forth and accept those connections responsibly, and remember: races are real, synchronous calls are spicy, and you are the main character. iykyk πŸ’–

this iconic little page is dated 27 Feb 2019 and comes to you straight from the gensio library, gensio_acc...back_enable(3) β€” mwah, no notes, obsessed. πŸŽ€πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from