| 115 | } |
| 116 | |
| 117 | void |
| 118 | on_read( |
| 119 | beast::error_code ec, |
| 120 | std::size_t bytes_transferred) |
| 121 | { |
| 122 | boost::ignore_unused(bytes_transferred); |
| 123 | |
| 124 | // This indicates that the session was closed |
| 125 | if(ec == websocket::error::closed) |
| 126 | return; |
| 127 | |
| 128 | if(ec) |
| 129 | return fail(ec, "read"); |
| 130 | |
| 131 | // Echo the message |
| 132 | ws_.text(ws_.got_text()); |
| 133 | ws_.async_write( |
| 134 | buffer_.data(), |
| 135 | beast::bind_front_handler( |
| 136 | &session::on_write, |
| 137 | shared_from_this())); |
| 138 | } |
| 139 | |
| 140 | void |
| 141 | on_write( |
nothing calls this directly
no test coverage detected