summaryrefslogtreecommitdiffstats
path: root/config/src/apps/vespa-configproxy-cmd/proxycmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'config/src/apps/vespa-configproxy-cmd/proxycmd.cpp')
-rw-r--r--config/src/apps/vespa-configproxy-cmd/proxycmd.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/config/src/apps/vespa-configproxy-cmd/proxycmd.cpp b/config/src/apps/vespa-configproxy-cmd/proxycmd.cpp
index 3407a880ec7..ce0665eae4a 100644
--- a/config/src/apps/vespa-configproxy-cmd/proxycmd.cpp
+++ b/config/src/apps/vespa-configproxy-cmd/proxycmd.cpp
@@ -16,41 +16,41 @@ Flags::Flags()
targethost("localhost"),
portnumber(19090)
{ }
-Flags::~Flags() { }
+Flags::~Flags() = default;
ProxyCmd::ProxyCmd(const Flags& flags)
- : _supervisor(NULL),
- _target(NULL),
- _req(NULL),
+ : _server(),
+ _supervisor(nullptr),
+ _target(nullptr),
+ _req(nullptr),
_flags(flags)
{ }
-ProxyCmd::~ProxyCmd() { }
+ProxyCmd::~ProxyCmd() = default;
void ProxyCmd::initRPC() {
- _supervisor = new FRT_Supervisor();
+ _server = std::make_unique<fnet::frt::StandaloneFRT>();
+ _supervisor = &_server->supervisor();
_req = _supervisor->AllocRPCRequest();
- _supervisor->Start();
}
void ProxyCmd::invokeRPC() {
- if (_req == NULL) return;
+ if (_req == nullptr) return;
_target->InvokeSync(_req, 65.0);
}
void ProxyCmd::finiRPC() {
- if (_req != NULL) {
+ if (_req != nullptr) {
_req->SubRef();
- _req = NULL;
+ _req = nullptr;
}
- if (_target != NULL) {
+ if (_target != nullptr) {
_target->SubRef();
_target = NULL;
}
- if (_supervisor != NULL) {
- _supervisor->ShutDown(true);
- delete _supervisor;
- _supervisor = NULL;
+ if (_server) {
+ _server.reset();
+ _supervisor = nullptr;
}
}