mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
fix: Guarantee async behaviour of WsBase::send (#2100)
This commit is contained in:
@@ -173,7 +173,8 @@ public:
|
||||
void
|
||||
send(std::shared_ptr<std::string> msg) override
|
||||
{
|
||||
boost::asio::dispatch(
|
||||
// Note: post used instead of dispatch to guarantee async behavior of wsFail and maybeSendNext
|
||||
boost::asio::post(
|
||||
derived().ws().get_executor(),
|
||||
[this, self = derived().shared_from_this(), msg = std::move(msg)]() {
|
||||
if (messages_.size() > maxSendingQueueSize_) {
|
||||
|
||||
Reference in New Issue
Block a user