lc_ctx_ratelimit3
Set send/recv ratelimits
Usage
#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.
Library
Librecast library (liblibrecast, -llibrecast)
Overview
The lc_ctx_ratelimit function sets the default ratelimits for subsequent sockets and channels created with context ctx.
bps_out and bps_in specify the ratelimits in bits per second for outbound (send) and inbound (recv) respectively. 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.
lc_channel_ratelimit(3) sets the rate limits for channel chan similarly.
Return value
These functions return no value.
Errors
None.
Notes
Only the send limit is enforced at this time.