RPC cleanup: RPCService is a sub-set of RPCServiceAsync
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user