| 133 | } |
| 134 | |
| 135 | void Connection::requestName(const ServiceName& name) |
| 136 | { |
| 137 | SDBUS_CHECK_SERVICE_NAME(name.c_str()); |
| 138 | |
| 139 | auto r = sdbus_->sd_bus_request_name(bus_.get(), name.c_str(), 0); |
| 140 | SDBUS_THROW_ERROR_IF(r < 0, "Failed to request bus name", -r); |
| 141 | |
| 142 | // In some cases we need to explicitly notify the event loop |
| 143 | // to process messages that may have arrived while executing the call |
| 144 | wakeUpEventLoopIfMessagesInQueue(); |
| 145 | } |
| 146 | |
| 147 | void Connection::releaseName(const ServiceName& name) |
| 148 | { |