1d4afb5ceSopenharmony_ci# lws minimal http client-h2-rxflow
2d4afb5ceSopenharmony_ci
3d4afb5ceSopenharmony_ciThe application reads from a server with tightly controlled and rate-limited
4d4afb5ceSopenharmony_cireceive flow control using h2 tx credit.
5d4afb5ceSopenharmony_ci
6d4afb5ceSopenharmony_ci## build
7d4afb5ceSopenharmony_ci
8d4afb5ceSopenharmony_ci```
9d4afb5ceSopenharmony_ci $ cmake . && make
10d4afb5ceSopenharmony_ci```
11d4afb5ceSopenharmony_ci
12d4afb5ceSopenharmony_ci## usage
13d4afb5ceSopenharmony_ci
14d4afb5ceSopenharmony_ciCommandline option|Meaning
15d4afb5ceSopenharmony_ci---|---
16d4afb5ceSopenharmony_ci-d <loglevel>|Debug verbosity in decimal, eg, -d15
17d4afb5ceSopenharmony_ci-l| Connect to https://localhost:7681 and accept selfsigned cert
18d4afb5ceSopenharmony_ci--server <name>|set server name to connect to
19d4afb5ceSopenharmony_ci--path <path>|URL path to access on server
20d4afb5ceSopenharmony_ci-k|Apply tls option LCCSCF_ALLOW_INSECURE
21d4afb5ceSopenharmony_ci-j|Apply tls option LCCSCF_ALLOW_SELFSIGNED
22d4afb5ceSopenharmony_ci-m|Apply tls option LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK
23d4afb5ceSopenharmony_ci-e|Apply tls option LCCSCF_ALLOW_EXPIRED
24d4afb5ceSopenharmony_ci-v|Connection validity use 3s / 10s instead of default 5m / 5m10s
25d4afb5ceSopenharmony_ci--nossl| disable ssl connection
26d4afb5ceSopenharmony_ci-f <initial credit>|Indicate we will manually manage tx credit and set a new connection-specific initial tx credit
27d4afb5ceSopenharmony_ci
28d4afb5ceSopenharmony_ciRX is constrained to 1024 bytes every 250ms
29d4afb5ceSopenharmony_ci
30d4afb5ceSopenharmony_ci```
31d4afb5ceSopenharmony_ci $ ./lws-minimal-http-client-h2-rxflow  --server phys.org --path "/" -f 1024
32d4afb5ceSopenharmony_ci[2019/12/26 13:32:59:6801] U: LWS minimal http client [-d<verbosity>] [-l] [--h1]
33d4afb5ceSopenharmony_ci[2019/12/26 13:33:00:5087] N: system_notify_cb: manual peer tx credit 1024
34d4afb5ceSopenharmony_ci[2019/12/26 13:33:01:7390] U: Connected to 72.251.236.55, http response: 200
35d4afb5ceSopenharmony_ci[2019/12/26 13:33:01:7441] U: RECEIVE_CLIENT_HTTP_READ: read 1024
36d4afb5ceSopenharmony_ci[2019/12/26 13:33:01:0855] U: RECEIVE_CLIENT_HTTP_READ: read 1024
37d4afb5ceSopenharmony_ci[2019/12/26 13:33:02:3367] U: RECEIVE_CLIENT_HTTP_READ: read 1024
38d4afb5ceSopenharmony_ci[2019/12/26 13:33:02:5858] U: RECEIVE_CLIENT_HTTP_READ: read 1024
39d4afb5ceSopenharmony_ci[2019/12/26 13:33:02:8384] U: RECEIVE_CLIENT_HTTP_READ: read 1024
40d4afb5ceSopenharmony_ci[2019/12/26 13:33:02:0886] U: RECEIVE_CLIENT_HTTP_READ: read 1024
41d4afb5ceSopenharmony_ci...
42d4afb5ceSopenharmony_ci[2019/12/26 13:33:46:1152] U: RECEIVE_CLIENT_HTTP_READ: read 1024
43d4afb5ceSopenharmony_ci[2019/12/26 13:33:47:3650] U: RECEIVE_CLIENT_HTTP_READ: read 1024
44d4afb5ceSopenharmony_ci[2019/12/26 13:33:47:6150] U: RECEIVE_CLIENT_HTTP_READ: read 1024
45d4afb5ceSopenharmony_ci[2019/12/26 13:33:47:8666] U: RECEIVE_CLIENT_HTTP_READ: read 1024
46d4afb5ceSopenharmony_ci[2019/12/26 13:33:47:1154] U: RECEIVE_CLIENT_HTTP_READ: read 1024
47d4afb5ceSopenharmony_ci[2019/12/26 13:33:48:3656] U: RECEIVE_CLIENT_HTTP_READ: read 1024
48d4afb5ceSopenharmony_ci[2019/12/26 13:33:48:6157] U: RECEIVE_CLIENT_HTTP_READ: read 380
49d4afb5ceSopenharmony_ci[2019/12/26 13:33:48:6219] U: LWS_CALLBACK_COMPLETED_CLIENT_HTTP
50d4afb5ceSopenharmony_ci[2019/12/26 13:33:48:7050] U: Completed: OK
51d4afb5ceSopenharmony_ci
52d4afb5ceSopenharmony_ci```
53d4afb5ceSopenharmony_ci
54