{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1711717255,
"reponame":"libwebsockets",
"desc":"libwebsockets lightweight C networking library",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"e40d0d95b0d08cb2c2212ed4545c49aa",
"oid":{ "oid": "e4be3317ee421f951fb16a85c7edacc9b8a0e6aa", "alias": [ "refs/heads/main"]},"blobname": "include/libwebsockets/lws-retry.h", "blob": "/*\n * libwebsockets - small server side websockets and web server implementation\n *\n * Copyright (C) 2010 - 2019 Andy Green \u003candy@warmcat.com\u003e\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \u0022Software\u0022), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \u0022AS IS\u0022, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\ntypedef struct lws_retry_bo {\n\tconst uint32_t\t*retry_ms_table;\t /* base delay in ms */\n\tuint16_t\tretry_ms_table_count; /* entries in table */\n\tuint16_t\tconceal_count;\t\t /* max retries to conceal */\n\tuint16_t\tsecs_since_valid_ping; /* idle before PING issued */\n\tuint16_t\tsecs_since_valid_hangup; /* idle before hangup conn */\n\tuint8_t\t\tjitter_percent;\t\t/* % additional random jitter */\n} lws_retry_bo_t;\n\n#define LWS_RETRY_CONCEAL_ALWAYS (0xffff)\n\n/**\n * lws_retry_get_delay_ms() - get next delay from backoff table\n *\n * \u005cparam lws_context: the lws context (used for getting random)\n * \u005cparam retry: the retry backoff table we are using, or NULL for default\n * \u005cparam ctry: pointer to the try counter\n * \u005cparam conceal: pointer to flag set to nonzero if the try should be concealed\n *\t\t\tin terms of creating an error\n *\n * Increments *\u005cp try and retruns the number of ms that should elapse before the\n * next connection retry, according to the backoff table \u005cp retry. *\u005cp conceal is\n * set if the number of tries is less than the backoff table conceal_count, or\n * is zero if it exceeded it. This lets you conceal a certain number of retries\n * before alerting the caller there is a problem.\n *\n * If \u005cp retry is NULL, a default of 3s + (0..300ms jitter) is used. If it's\n * non-NULL but jitter_percent is 0, the default of 30% jitter is retained.\n */\n\nLWS_VISIBLE LWS_EXTERN unsigned int\nlws_retry_get_delay_ms(struct lws_context *context, const lws_retry_bo_t *retry,\n\t\t uint16_t *ctry, char *conceal);\n\n/**\n * lws_retry_sul_schedule() - schedule a sul according to the backoff table\n *\n * \u005cparam lws_context: the lws context (used for getting random)\n * \u005cparam sul: pointer to the sul to schedule\n * \u005cparam retry: the retry backoff table we are using, or NULL for default\n * \u005cparam cb: the callback for when the sul schedule time arrives\n * \u005cparam ctry: pointer to the try counter\n *\n * Helper that combines interpreting the retry table with scheduling a sul to\n * the computed delay. If conceal is not set, it will not schedule the sul\n * and just return 1. Otherwise the sul is scheduled and it returns 0.\n */\nLWS_VISIBLE LWS_EXTERN int\nlws_retry_sul_schedule(struct lws_context *context, int tid,\n\t\t lws_sorted_usec_list_t *sul, const lws_retry_bo_t *retry,\n\t\t sul_cb_t cb, uint16_t *ctry);\n\n/**\n * lws_retry_sul_schedule_retry_wsi() - retry sul schedule helper using wsi\n *\n * \u005cparam wsi: the wsi to set the hrtimer sul on to the next retry interval\n * \u005cparam sul: pointer to the sul to schedule\n * \u005cparam cb: the callback for when the sul schedule time arrives\n * \u005cparam ctry: pointer to the try counter\n *\n * Helper that uses context, tid and retry policy from a wsi to call\n * lws_retry_sul_schedule.\n *\n * Since a udp connection can have many writes in flight, the retry count and\n * the sul used to track each thing that wants to be written have to be handled\n * individually, not the wsi. But the retry policy and the other things can\n * be filled in from the wsi conveniently.\n */\nLWS_VISIBLE LWS_EXTERN int\nlws_retry_sul_schedule_retry_wsi(struct lws *wsi, lws_sorted_usec_list_t *sul,\n\t\t\t\t sul_cb_t cb, uint16_t *ctry);\n","s":{"c":1711717255,"u": 322}}
],"g": 1910,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 1, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}