News for hackers. Stuff that matters.
Re:A Universal I/O Abstraction for C++ (2020) by nly on Monday April 19, 2021 @05:24AM (#26860684)
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/be...

[1] https://www.boost.org/doc/libs/1_70_0/libs/beast/example/web...

[2] http://nghttp2.org/documentation/libnghttp2_asio.html

Re:A Universal I/O Abstraction for C++ (2020) by secondcoming on Monday April 19, 2021 @07:20AM (#26861424)
We 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.