LC_CTX_RATELIMIT(3)
π LC_CTX_RATELIMIT(3) β the Librecast Programmer's Manual, bestie edition π
okay so. you're here because you wanna put a lil speed limit on your sockets and channels. no cap, this is the page for that. it's a section 3 man page from the Librecast programmer's manual, and we're gonna get you fluent in it. π¦
β¨ NAME β¨
lc_ctx_ratelimit, lc_channel_ratelimit β set send/recv ratelimits
literally what it says. you set the limits, the vibes stay calm. π
π LIBRARY π
Librecast library (liblibrecast, -llibrecast)
πΈ SYNOPSIS πΈ
#include <librecast/net.h>
void lc_ctx_ratelimit(lc_ctx_t *ctx, size_t bps_out, size_t bps_in);
void lc_channel_ratelimit(lc_channel_t *chan, size_t bps_out, size_t bps_in);
Compile and link with -llibrecast.
like, don't forget that flag. she's essential. π
π« DESCRIPTION π«
So lc_ctx_ratelimit sets the default ratelimits for subsequent sockets and channels created with context ctx. future you's sockets. the ones not born yet. it's giving "setting the vibe for the children." π§
bps_out and bps_in specify the ratelimits in bits per second for outbound (send) and inbound (recv) respectively. yes bestie, bits, not bytes, don't come for me, that's what it says. These limits are applied to future sockets and channels created with lc_socket_new(3) and lc_channel_new(3).
β οΈ Existing sockets and channels are unaffected. they already got their vibe check. no takebacks. π
lc_channel_ratelimit(3) sets the rate limits for channel chan similarly. same energy, different target. one's the whole context, one's a single channel. slay. β¨
π RETURN VALUE π
These functions return no value. void. nothing. empty-handed but make it iconic. π«Ά
π ERRORS π
None.
not a single one. no errors, no drama, no chaos. we love a low-maintenance function. π
π NOTES π
Only the send limit is enforced at this time.
so like, recv is out here living its truth unregulated for now. not me pointing that out, the man page did. π
π SEE ALSO π
lc_ctx_new(3)lc_ctx_free(3)lc_socket_new(3)lc_channel_new(3)lc_channel_ratelimit(3)
go read those next, bestie, the lore runs deep. π
π the sign-off π
This whole thing came to you from LIBRECAST, dated 2023-07-23, and it lives under the name LC_CTX_RATELIMIT(3). that's the tea. drink responsibly. π β¨πΈ
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms