RPC cleanup: RPCService is a sub-set of RPCServiceAsync

This commit is contained in:
Michael Davidsaver
2017-07-10 17:17:07 +02:00
parent b6bd7eebe5
commit 5d843d3587
5 changed files with 141 additions and 128 deletions

View File

@@ -6,3 +6,30 @@
#define epicsExportSharedSymbols
#include <pv/rpcService.h>
namespace pvd = epics::pvData;
namespace epics{namespace pvAccess{
void RPCService::request(
pvd::PVStructure::shared_pointer const & args,
RPCResponseCallback::shared_pointer const & callback)
{
assert(callback && args);
pvd::PVStructure::shared_pointer ret;
pvd::Status sts;
try {
ret = request(args);
}catch(RPCRequestException& e){
sts = e.asStatus();
throw;
}catch(std::exception& e){
sts = pvd::Status::error(e.what());
}
if(!ret) {
sts = pvd::Status(pvd::Status::STATUSTYPE_FATAL, "RPCService.request(PVStructure) returned null.");
}
callback->requestDone(sts, ret);
}
}} // namespace epics::pvAccess