3 ms·
Boost Beast, which is built on ASIO, has support for timeouts[0], as well as HTTP 1.1 and Websockets. The examples in the Beast tree do do some pretty complex s
by nly 6y ago
Boost Beast, which is built on ASIO, has support for timeouts[0], as well as HTTP 1.1 and Websockets. The examples in the Beast tree do do some pretty complex stuff elegantly, like a multi-client chat server[1], so it's possible.
There's also nghttp2_asio, built on nghttp2, which supports HTTP/2[2].
Overall I agree though that ASIO is a very complex and very low level, and it's a lot of work to use it well.
Sometimes it's easiest just to use libcurl.
[0] https://www.boost.org/doc/libs/1_76_0/libs/beast/doc/html/beast/using_io/timeouts.html https://www.boost.org/doc/libs/1_76_0/libs/beast/doc/html/be...
[1] https://www.boost.org/doc/libs/1_70_0/libs/beast/example/websocket/server/chat-multi/ https://www.boost.org/doc/libs/1_70_0/libs/beast/example/web...
[2] http://nghttp2.org/documentation/libnghttp2_asio.html http://nghttp2.org/documentation/libnghttp2_asio.html
- secondcoming 6y agoWe actually changed from libcurl to ASIO because libcurl creates a thread for every request, and it didn't handle concurrency well (I forget the exact details but it would crash if you added a curl handle to a curl_multi session if that session was already in progess) Our use case sends thousands of requests per second per machine.