Beast: pausation::emplace BOOST_ASSERT(! base_);

Created on 9 Jul 2017  路  5Comments  路  Source: boostorg/beast

Hello, Can I call ws.async_read and ws.async_write methods from different threads? Because I have error:

pausation.hpp:149
void beast::websocket::detail::pausation::emplace(F&&) [with F = beast::websocket::stream&>::write_frame_op >, beast::websocket::stream&>::write_op

All 5 comments

You cannot call any members from different threads concurrently. You have to make all your calls from the same implicit or explicit strand. Beast websocket streams work just like Asio streams - they are not thread-safe (even though you are using threads in your io_service).

Thank you, but it does not help me, I use one thread for my 'async_read' and 'async_write' operations now but I have error still.

pausation.hpp:149
void beast::websocket::detail::pausation::emplace(F&&) [with F = beast::websocket::streamboost::asio::basic_stream_socket

What I can do? Thank you.

The other reason that this assert comes up is if you try to call async_read or async_write twice without an intermediate completion. Is your code on GitHub where I can see it? Or can you post a gist?

Thank you very much, it help me. I call "async_write" several without an intermediate completion.

Sounds like this is resolved, so I'll go ahead and close the issue. If you have another problem feel free to open a new issue any time, thanks!

Was this page helpful?
0 / 5 - 0 ratings