Mohammad Nejati

Results 144 comments of Mohammad Nejati

@hoyhoy Regarding the performance, make sure you are building the application in release mode. Boost.Beast and Boost.Asio have a lot of indirection and generic functions, which result in very slow...

You are correct; access to `std::cerr` is not thread-safe, resulting in a ThreadSanitizer warning. If you are using C++ 20, you can encapsulate `std::cerr` within a `std::osyncstream`. Please keep this...

The problem is that you are treating async operations as if they finish immediately. You need to have a mechanism to wait for operations until they complete. It is not...

@shivank1111, a bad_weak_ptr exception indicates you likely have lifetime issues in your code. Try running the code in your debugger to pinpoint where the exception is thrown; this will provide...

There are multiple life time issues in your code: These functions are taking reference to a shared pointer while the shared pointer itself is not stored anywhere: ```CPP void send(std::shared_ptr...

This is not planned, as there is an ongoing effort to make Boost modular. Therefore, you would only need to install the Boost libraries that Beast depends on.

Sorry for the late reply; I missed the notification. Replacing the dependencies and maintaining two versions wouldn't be trivial, especially if you want to support C++11. What is the motivating...

Yes, considering that Beast targets C++11, it had to use more facilities from Boost. However, how is this an issue, and what would be the benefits of reducing their usage?

> I guess the same benefits as standalone ASIO. No need to bring tons of 3rd party stuff(even if modular) given the C++ version we are using already have these...

You can utilize a [http::buffer_body](https://www.boost.org/doc/libs/1_84_0/libs/beast/doc/html/beast/ref/boost__beast__http__buffer_body.html) and a fixed size buffer for that purpose, these examples might help: https://www.boost.org/doc/libs/1_84_0/libs/beast/doc/html/beast/more_examples/http_relay.html https://www.boost.org/doc/libs/1_84_0/libs/beast/doc/html/beast/using_http/parser_stream_operations/incremental_read.html