Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1750741867, "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", "oid":{ "oid": "0f42f0d9ad2c2b3eb70f8d776d6d54c69a54f9d0", "alias": []},"tree": [ { "name": "CMakeLists.txt","mode": "33188", "size":788}, { "name": "README.md","mode": "33188", "size":3591}, { "name": "main.c","mode": "33188", "size":10901}],"s":{"c":1750672528,"u": 438}} ,{"schema":"libjg2-1", "cid":"4c37f9e88edf4769ed432544d610723d", "oid":{ "oid": "0f42f0d9ad2c2b3eb70f8d776d6d54c69a54f9d0", "alias": []},"blobname": "minimal-examples/ws-client/minimal-ws-client-binance/README.md", "blob": "# lws minimal ws client binance\n\nThis connects to the binance ws server and monitors transactions with\nan eye on low latency.\n\nLatency seems to be associated with server-side coalescing at tls\nlayer, and the coalescing at server side seems somewhat correlated to number\nof transactions per second, which seems to cause increased packet sizes from the\nserver as a reaction. The relationship is more complex probably according to what\nactually happens at the server backend, but it seems to be broadly related\nreliably.\n\nTypically when showing low latency at ~70msg/s, the messages on the wire are\neg, ~70 byte packets containing small tls records\n\n10:14:40.682293 IP ec2-54-249-113-172.ap-northeast-1.compute.amazonaws.com.https \u003e constance.42952: Flags [P.], seq 50846:50927, ack 1, win 11, options [nop,nop,TS val 366445630 ecr 3893437035], length 81\n\nunder pressure from increased messages per second, the tls records increase above 2KB\n\n08:06:02.825160 IP ec2-54-249-113-172.ap-northeast-1.compute.amazonaws.com.https \u003e constance.42688: Flags [.], seq 512319:513643, ack 1, win 11, options [nop,nop,TS val 3990208942 ecr 3885719233], length 1324\n08:06:02.825290 IP constance.42688 \u003e ec2-54-249-113-172.ap-northeast-1.compute.amazonaws.com.https: Flags [.], ack 513643, win 14248, options [nop,nop,TS val 3885719479 ecr 3990208942], length 0\n08:06:02.891646 IP ec2-54-249-113-172.ap-northeast-1.compute.amazonaws.com.https \u003e constance.42688: Flags [.], seq 513643:516291, ack 1, win 11, options [nop,nop,TS val 3990209006 ecr 3885719296], length 2648\n\nThe larger the packets, the longer the first item in the packet had to\nwait before it was sent, and a tls record cannot be authenticated until\nall of it has been received.\n\nThe example circumvents this somewhat by using `permessage_deflate`, which reduces\nthe packet size before tls by applying compression, making even coalesced packets\nsmaller, and a new option for adjusting how lws manages conflicting requirements to\nclear pending rx and allow interleaved tx, `LCCSCF_PRIORITIZE_READS` that causes the\nstream to prioritize handling any pending rx, not just pending at ssl layer, in one\nevent loop trip.\n\n## build\n\nLws must have been built with `LWS_ROLE_WS\u003d1` and `LWS_WITHOUT_EXTENSIONS\u003d0`\n\n```\n $ cmake . \u0026\u0026 make\n```\n\n## Commandline Options\n\nOption|Meaning\n---|---\n-d|Set logging verbosity\n\n## usage\n\n```\n$ ./bin/lws-minimal-ws-client-binance \n[2020/08/23 10:22:49:3003] U: LWS minimal binance client\n[2020/08/23 10:22:49:3005] N: LWS: 4.0.99-v4.1.0-rc2-4-g3cf133aef, loglevel 1031\n[2020/08/23 10:22:49:3005] N: NET CLI SRV H1 H2 WS MQTT SS-JSON-POL SSPROX ASYNC_DNS IPv6-absent\n[2020/08/23 10:22:50:8243] N: checking client ext permessage-deflate\n[2020/08/23 10:22:50:8244] N: instantiating client ext permessage-deflate\n[2020/08/23 10:22:50:8244] U: callback_minimal: established\n[2020/08/23 10:22:51:8244] N: sul_hz_cb: price: min: 1160284¢, max: 1163794¢, avg: 1160516¢, (150 prices/s)\n[2020/08/23 10:22:51:8245] N: sul_hz_cb: elatency: min: 112ms, max: 547ms, avg: 259ms, (155 msg/s)\n[2020/08/23 10:22:52:8244] N: sul_hz_cb: price: min: 1160287¢, max: 1178845¢, avg: 1160897¢, (112 prices/s)\n[2020/08/23 10:22:52:8245] N: sul_hz_cb: elatency: min: 111ms, max: 226ms, avg: 152ms, (134 msg/s)\n[2020/08/23 10:22:53:8247] N: sul_hz_cb: price: min: 1160287¢, max: 1168005¢, avg: 1160806¢, (86 prices/s)\n[2020/08/23 10:22:53:8248] N: sul_hz_cb: elatency: min: 112ms, max: 476ms, avg: 287ms, (101 msg/s)\n[2020/08/23 10:22:54:8247] N: sul_hz_cb: price: min: 1160284¢, max: 1162780¢, avg: 1160698¢, (71 prices/s)\n...\n```\n","s":{"c":1750672528,"u": 158}} ],"g": 1293,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}