WSLAY_EVENT_CO...ET_NO_BUFFERING(3)

πŸ’… WSLAY_EVENT_CONFIG_SET_NO_BUFFERING β€” wslay manual, section 3 πŸ¦‹

okay bestie, sit down, hydrate, because we're talking about wslay_event_config_set_no_buffering() from the wslay library and it's literally the switch that decides whether your non-control frames get the whole-message-buffer treatment or not. no cap. πŸ’–


✨ NAME ✨

wslay_event_config_set_no_buffering β€” turn the buffering of an entire message on or off for non-control frames πŸ‘‘


🌸 SYNOPSIS 🌸

#include <wslay/wslay.h>

void wslay_event_config_set_no_buffering(wslay_event_context_ptr ctx,
int val)

like, that's the whole vibe. you pass it your context pointer and an int and it does the thing. ✨


πŸŽ€ DESCRIPTION πŸŽ€

so wslay_event_config_set_no_buffering() enables or disables buffering of an entire message for non-control frames. that's the job. that's the whole job. πŸ’…

here's the tea on val:

  • if val is 0 β†’ buffering is enabled 🫢
  • otherwise (literally anything else) β†’ buffering is disabled 😭

and now the part you actually need to remember: if wslay_event_on_msg_recv_callback gets invoked while buffering is disabled, the msg_length member of struct wslay_event_on_msg_recv_arg is set to 0. yes, zero. that's not a typo, that's the documented behaviour, periodt. ⭐

control frames are ALWAYS buffered regardless of this function call. like, they don't care what you set. they're built different. no buffering opt-out for them, sorry bestie. 🧚
BIG ONE: this function must not be used after the first invocation of the wslay_event_recv() function. that's not a suggestion, that's a rule. call it early, call it once, call it before you start receiving. after that? it's giving forbidden. πŸ’€

🌈 SEE ALSO 🌈

  • wslay_event_recv()

πŸ‘‘ AUTHOR πŸ‘‘

Tatsuhiro Tsujikawa β€” the icon, the legend, the main character who wrote all this down for us. 🫢


2024, 2015, Tatsuhiro Tsujikawa


okay that's the whole page, you ate it, you understood it, we're obsessed. πŸ’– this lil writeup came from the wslay manual, stamped with version @PACKAGE_VERSION@ and dated Apr 22, 20, and yes i'm telling you all of that at the very end like a little bow on top of the gift. bye bestie, go buffer responsibly πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from