| 246 | } |
| 247 | |
| 248 | void await_output() |
| 249 | { |
| 250 | auto self(shared_from_this()); |
| 251 | non_empty_output_queue_.async_wait( |
| 252 | [this, self](const boost::system::error_code& /*error*/) |
| 253 | { |
| 254 | // Check if the session was stopped while the operation was pending. |
| 255 | if (stopped()) |
| 256 | return; |
| 257 | |
| 258 | if (output_queue_.empty()) |
| 259 | { |
| 260 | // There are no messages that are ready to be sent. The actor goes |
| 261 | // to sleep by waiting on the non_empty_output_queue_ timer. When a |
| 262 | // new message is added, the timer will be modified and the actor |
| 263 | // will wake. |
| 264 | non_empty_output_queue_.expires_at(steady_timer::time_point::max()); |
| 265 | await_output(); |
| 266 | } |
| 267 | else |
| 268 | { |
| 269 | write_line(); |
| 270 | } |
| 271 | }); |
| 272 | } |
| 273 | |
| 274 | void write_line() |
| 275 | { |
nothing calls this directly
no test coverage detected