Comments (6)
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.
from beast.
The issue is associated with creating a work_guard from a strand<any_io_executor>
. It attempts to utilize on_work_started()
and on_work_finished()
functions, which are not defined for asio::any_io_executor
. This results in a compile error in websocket::stream<tcp>::async_write
because it attempts to create a work_guard from the associated executor.
It can be reproduced with the following code as well: https://godbolt.org/z/nvr9jjnrY
#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.
from beast.
I'm not 100% sure but passing strand.get_inner_executor()
to make_work_guard
could solve the issue ?
#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());
}
https://godbolt.org/z/jv1zEW7ET
from beast.
I'm not 100% sure but passing
strand.get_inner_executor()
tomake_work_guard
could solve the issue ?
This will generate a work guard for any_io_executor
instead of strand<any_io_executor>
. Calling get_executor on this work guard will return an instance of any_io_executor
.
Although I believe it will function correctly in this case, as we don't retrieve the executor from the work guard, I am seeking a cleaner solution or addressing this in Asio.
from beast.
I've raised an issue in Asio for this; let's see what will be the response. chriskohlhoff/asio#1394
from beast.
chriskohlhoff/asio#1394 still no response. It seems that there are a lot of uncommented issues in the project.
I think that this issue is often appered using C++20 coroutine with strand in the real world.
See https://godbolt.org/z/7EnWa3Es1
If there were no update until the next release, I would appliciate if you implemented some workaround on the beast side .
from beast.
Related Issues (20)
- read message error: wrong version number (SSL routines, ssl3_get_record) HOT 7
- Custom Body Type or `response_serializer` for incrementally streaming large amounts of data back to the client HOT 3
- WebSocket Server Awaitable Example Error
- [Need help] A passive and proactive websocket client HOT 5
- Send data through a websocket connection from a separated thread HOT 4
- Using /O1 optimization in vs2017 will trigger a crash HOT 6
- [Help] Correctly handle message loop on idle websocket connection HOT 16
- Multiple web socket client issues HOT 18
- `zlib::deflate_stream::write` documentation wall of text HOT 1
- Discarding request body without needing a temporary buffer HOT 6
- Ergonomics of error list in `http::async_read` and `http::async_read_header` HOT 4
- Suggestion: Make incremental HTTP reading as easy as incremental HTTP writing HOT 7
- ecorm's List of Pain Points HOT 14
- multiplexing HOT 6
- p0-.,\ HOT 1
- resolver.async_resolve hang issue HOT 2
- http::async_read hides client disconnection errors HOT 7
- http client tcp ssl stream async_shutdown blocks forever HOT 13
- Double definition of zlib DEF_MEM_LEVEL HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beast.