-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error when any_io_executor based websocket stream with bind_executor strand #2775
Comments
The issue is associated with creating a work_guard from a #include <boost/asio.hpp>
namespace asio = boost::asio;
int main()
{
asio::io_context ioc;
asio::any_io_executor exec = ioc.get_executor();
auto strand = asio::make_strand(exec);
auto wg = asio::make_work_guard(strand);
} I will further investigate to determine whether we can address this in Beast or if it is a bug in Asio. |
I'm not 100% sure but passing #include <boost/asio.hpp>
namespace asio = boost::asio;
int main()
{
asio::io_context ioc;
asio::any_io_executor exec = ioc.get_executor();
auto strand = asio::make_strand(exec);
auto wg = asio::make_work_guard(strand.get_inner_executor());
} |
This will generate a work guard for |
I've raised an issue in Asio for this; let's see what will be the response. chriskohlhoff/asio#1394 |
ws and wss don't support any_io_executor due to the following issue: boostorg/beast#2775
chriskohlhoff/asio#1394 still no response. It seems that there are a lot of uncommented issues in the project. |
Yeah, Chris usually doesn't respond to the issues, but he reads them. We should track the changes in the repository to see if it gets fixed or not. |
Boost 1.85.0 has been released. Any updates about the issue? |
No, unfortunately, this issue, along with many others, hasn't been addressed in the Asio for 1.85.0 release. |
I noticed that I used strand in an unusual way; my library no longer uses strand like that. Here is another proof-of-concept (PoC) code example based on the code I initially reported: https://godbolt.org/z/1q6vxzfja net::bind_executor(
net::any_io_executor{str}, // no error, strand still effects
[](auto, auto){}
) My issue has been solved, but I leave it up to you whether to close the issue or not. |
Thanks for reporting this. The root cause of the issue is creating a I would suggest keeping this issue open as this is more of a workaround and the root cause still exists. |
Version of Beast
Steps necessary to reproduce the problem
Compile the following code:
Got the following compile error:
godbolt link(x86-64 clang 17.0.1) : https://godbolt.org/z/nocj654EK
All relevant compiler information
What I noticed
tcp
doesn't cause the error.ws
withbind_executor
strand.ws
containstcp
as the next layer.tcp
hasany_io_executor
.str
is created bymake_strand
andany_io_executor
exe
is passed.The text was updated successfully, but these errors were encountered: