Get on the correct executor
| 57 | |
| 58 | // Get on the correct executor |
| 59 | void |
| 60 | run() |
| 61 | { |
| 62 | // We need to be executing within a strand to perform async operations |
| 63 | // on the I/O objects in this session. Although not strictly necessary |
| 64 | // for single-threaded contexts, this example code is written to be |
| 65 | // thread-safe by default. |
| 66 | net::dispatch(ws_.get_executor(), |
| 67 | beast::bind_front_handler( |
| 68 | &session::on_run, |
| 69 | shared_from_this())); |
| 70 | } |
| 71 | |
| 72 | // Start the asynchronous operation |
| 73 | void |