1# lws minimal http client attach 2 3This demonstrates how other threads can reach out to an existing lws_context 4and join its event loop cleanly and safely. 5 6## build 7 8``` 9 $ cmake . && make 10``` 11 12Pthreads is required on your system. 13 14## usage 15 16``` 17 $ ./lws-minimal-http-client-attach 18[2019/12/31 18:30:49:3495] U: main: main thread tid 0x503e1c0 19[2019/12/31 18:30:50:3584] U: LWS minimal http client attach 20[2019/12/31 18:30:50:4002] U: lws_create: tid 0x5c41700 21[2019/12/31 18:30:50:5727] E: callback_ntpc: set up system ops for set_clock 22[2019/12/31 18:30:50:2110] N: callback_ntpc: Unix time: 1577817053 23[2019/12/31 18:30:50:2136] U: attach_callback: called from tid 0x5c41700 24[2019/12/31 18:30:51:8733] U: Connected to 46.105.127.147, http response: 200 25[2019/12/31 18:30:51:8818] U: RECEIVE_CLIENT_HTTP_READ: read 4087 26[2019/12/31 18:30:51:8823] U: RECEIVE_CLIENT_HTTP_READ: read 4096 27[2019/12/31 18:30:51:8846] U: RECEIVE_CLIENT_HTTP_READ: read 4087 28[2019/12/31 18:30:51:8847] U: RECEIVE_CLIENT_HTTP_READ: read 4096 29[2019/12/31 18:30:51:8855] U: RECEIVE_CLIENT_HTTP_READ: read 4087 30[2019/12/31 18:30:51:8856] U: RECEIVE_CLIENT_HTTP_READ: read 4096 31[2019/12/31 18:30:51:8860] U: RECEIVE_CLIENT_HTTP_READ: read 1971 32[2019/12/31 18:30:51:8873] U: LWS_CALLBACK_COMPLETED_CLIENT_HTTP 33[2019/12/31 18:30:51:9629] U: main: finished 34``` 35 36