| 27 | static DbgCtl dbg_ctl{"rpc"}; |
| 28 | |
| 29 | RPCServer::RPCServer(config::RPCConfig const &conf) |
| 30 | { |
| 31 | switch (conf.get_comm_type()) { |
| 32 | case config::RPCConfig::CommType::UNIX: { |
| 33 | _socketImpl = std::make_unique<comm::IPCSocketServer>(); |
| 34 | if (!_socketImpl->configure(conf.get_comm_config_params())) { |
| 35 | Dbg(dbg_ctl, "Unable to configure the socket: Stick to the default configuration."); |
| 36 | } |
| 37 | } break; |
| 38 | default:; |
| 39 | throw std::runtime_error("Unsupported communication type."); |
| 40 | }; |
| 41 | |
| 42 | // make sure we can initialize it. |
| 43 | if (auto ec = _socketImpl->init(); ec) { |
| 44 | throw std::runtime_error(ec.message()); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | std::string_view |
| 49 | RPCServer::selected_comm_name() const noexcept |
nothing calls this directly
no test coverage detected