| 201 | } |
| 202 | |
| 203 | void HttpServer::Stop() |
| 204 | { |
| 205 | if (!_impl) { |
| 206 | return; |
| 207 | } |
| 208 | std::lock_guard<std::mutex> lock(_impl->mutex); |
| 209 | if (_impl->server) { |
| 210 | _impl->server->stop(); |
| 211 | } |
| 212 | if (_impl->thread.joinable()) { |
| 213 | _impl->thread.join(); |
| 214 | } |
| 215 | _impl->server.reset(); |
| 216 | _impl->listening.store(false); |
| 217 | } |
| 218 | |
| 219 | HttpRequestBuffer HttpServer::RegisterForRequests() |
| 220 | { |