| 31 | } |
| 32 | |
| 33 | void write(const chat_message& msg) |
| 34 | { |
| 35 | boost::asio::post(io_context_, |
| 36 | [this, msg]() |
| 37 | { |
| 38 | bool write_in_progress = !write_msgs_.empty(); |
| 39 | write_msgs_.push_back(msg); |
| 40 | if (!write_in_progress) |
| 41 | { |
| 42 | do_write(); |
| 43 | } |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | void close() |
| 48 | { |
no test coverage detected