Andy Green | e052edb | 2018-03-29 11:45:43 +0800 | [diff] [blame^] | 1 | # lws minimal http server libuv foreign |
| 2 | |
| 3 | This demonstrates having lws take part in a libuv loop owned by |
| 4 | something else, with its own objects running in the loop. |
| 5 | |
| 6 | Lws can join the loop, and clean up perfectly after itself. |
| 7 | |
| 8 | ## build |
| 9 | |
| 10 | ``` |
| 11 | $ cmake . && make |
| 12 | ``` |
| 13 | |
| 14 | ## usage |
| 15 | |
| 16 | ``` |
| 17 | $ ./lws-minimal-http-server-libuv-foreign |
| 18 | [2018/03/29 12:19:31:3480] USER: LWS minimal http server libuv + foreign loop | visit http://localhost:7681 |
| 19 | [2018/03/29 12:19:31:3724] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 off |
| 20 | [2018/03/29 12:19:31:3804] NOTICE: Using foreign event loop... |
| 21 | [2018/03/29 12:19:31:3938] USER: Foreign 1Hz timer |
| 22 | [2018/03/29 12:19:32:4011] USER: Foreign 1Hz timer |
| 23 | [2018/03/29 12:19:33:4024] USER: Foreign 1Hz timer |
| 24 | ^C[2018/03/29 12:19:33:8868] NOTICE: Signal 2 caught, exiting... |
| 25 | [2018/03/29 12:19:33:8963] USER: main: starting exit cleanup... |
| 26 | [2018/03/29 12:19:33:9064] USER: main: lws context destroyed: cleaning the foreign loop |
| 27 | [2018/03/29 12:19:33:9108] USER: main: exiting... |
| 28 | ``` |
| 29 | |
| 30 | Visit http://localhost:7681 |
| 31 | |