| 60 | using namespace http; |
| 61 | |
| 62 | Server::Server(const std::string &address, uint16_t port, request_handler &&r_handler, disconnect_handler &&d_handler) |
| 63 | : r_handler(std::move(r_handler)), d_handler(std::move(d_handler)) { |
| 64 | if (global_server) |
| 65 | throw std::runtime_error("You can have only 1 server for now"); |
| 66 | global_server = this; |
| 67 | } |
| 68 | |
| 69 | Server::~Server() { |
| 70 | if (global_server == this) // Must be always |
nothing calls this directly
no outgoing calls
no test coverage detected