Go to the source code of this file.
|
LWS_VISIBLE LWS_EXTERN unsigned int | lws_retry_get_delay_ms (struct lws_context *context, const lws_retry_bo_t *retry, uint16_t *ctry, char *conceal) |
|
LWS_VISIBLE LWS_EXTERN int | lws_retry_sul_schedule (struct lws_context *context, int tid, lws_sorted_usec_list_t *sul, const lws_retry_bo_t *retry, sul_cb_t cb, uint16_t *ctry) |
|
LWS_VISIBLE LWS_EXTERN int | lws_retry_sul_schedule_retry_wsi (struct lws *wsi, lws_sorted_usec_list_t *sul, sul_cb_t cb, uint16_t *ctry) |
|
◆ lws_retry_bo
◆ LWS_RETRY_CONCEAL_ALWAYS
#define LWS_RETRY_CONCEAL_ALWAYS (0xffff) |
◆ lws_retry_bo_t
◆ lws_retry_get_delay_ms()
lws_retry_get_delay_ms() - get next delay from backoff table
- Parameters
-
lws_context | the lws context (used for getting random) |
retry | the retry backoff table we are using, or NULL for default |
ctry | pointer to the try counter |
conceal | pointer to flag set to nonzero if the try should be concealed in terms of creating an error |
Increments *try
and retruns the number of ms that should elapse before the next connection retry, according to the backoff table retry
. *conceal
is set if the number of tries is less than the backoff table conceal_count, or is zero if it exceeded it. This lets you conceal a certain number of retries before alerting the caller there is a problem.
If retry
is NULL, a default of 3s + (0..300ms jitter) is used. If it's non-NULL but jitter_percent is 0, the default of 30% jitter is retained.
◆ lws_retry_sul_schedule()
lws_retry_sul_schedule() - schedule a sul according to the backoff table
- Parameters
-
lws_context | the lws context (used for getting random) |
sul | pointer to the sul to schedule |
retry | the retry backoff table we are using, or NULL for default |
cb | the callback for when the sul schedule time arrives |
ctry | pointer to the try counter |
Helper that combines interpreting the retry table with scheduling a sul to the computed delay. If conceal is not set, it will not schedule the sul and just return 1. Otherwise the sul is scheduled and it returns 0.
◆ lws_retry_sul_schedule_retry_wsi()
lws_retry_sul_schedule_retry_wsi() - retry sul schedule helper using wsi
- Parameters
-
wsi | the wsi to set the hrtimer sul on to the next retry interval |
sul | pointer to the sul to schedule |
cb | the callback for when the sul schedule time arrives |
ctry | pointer to the try counter |
Helper that uses context, tid and retry policy from a wsi to call lws_retry_sul_schedule.
Since a udp connection can have many writes in flight, the retry count and the sul used to track each thing that wants to be written have to be handled individually, not the wsi. But the retry policy and the other things can be filled in from the wsi conveniently.