{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1745907892,
"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":"9fc205de778985c05ba9f6007a91655d",
"commit": {"type":"commit",
"time": 1505954756,
"time_ofs": 480,
"oid_tree": { "oid": "b07a3d630a08763ac46b1f1a56a876738d5ac8c4", "alias": []},
"oid":{ "oid": "f85a1d42d8386b349527eefceb59ab3eaadb2cad", "alias": []},
"msg": "docs: README.coding.md: add explicit note about external poll loop forced service",
"sig_commit": { "git_time": { "time": 1505954756, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1505862455, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "docs: README.coding.md: add explicit note about external poll loop forced service"
,
"diff": "diff --git a/README.coding.md b/README.coding.md\nindex 34ce55c..03dc6bf 100644\n--- a/README.coding.md\n+++ b/README.coding.md\n@@ -278,6 +278,26 @@ reflecting the real event:\n - use LWS_POLLHUP / LWS_POLLIN / LWS_POLLOUT from libwebsockets.h to avoid\n losing windows compatibility\n \n+You also need to take care about \u0022forced service\u0022 somehow... these are cases\n+where the network event was consumed, incoming data was all read, for example,\n+but the work arising from it was not completed. There will not be any more\n+network event to trigger the remaining work, Eg, we read compressed data, but\n+we did not use up all the decompressed data before returning to the event loop\n+because we had to write some of it.\n+\n+Lws provides an API to determine if anyone is waiting for forced service,\n+`lws_service_adjust_timeout(context, 1, tsi)`, normally tsi is 0. If it returns\n+0, then at least one connection has pending work you can get done by calling\n+`lws_service_tsi(context, -1, tsi)`, again normally tsi is 0.\n+\n+For eg, the default poll() event loop, or libuv/ev/event, lws does this\n+checking for you and handles it automatically. But in the external polling\n+loop case, you must do it explicitly. Handling it after every normal service\n+triggered by the external poll fd should be enough, since the situations needing\n+it are initially triggered by actual network events.\n+\n+An example of handling it is shown in the test-server code specific to\n+external polling.\n \n @section cpp Using with in c++ apps\n \n","s":{"c":1745907892,"u": 3361}}
],"g": 4927,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}