add RPC loopback test

This commit is contained in:
Michael Davidsaver
2017-07-03 19:24:01 +02:00
parent 3eb601c210
commit 4fe837c9a0
7 changed files with 118 additions and 7 deletions
+2 -3
View File
@@ -38,12 +38,10 @@ private:
std::tr1::shared_ptr<ServerContext> m_serverContext;
ChannelProvider::shared_pointer m_channelProviderImpl;
// TODO no thread poll implementation
public:
POINTER_DEFINITIONS(RPCServer);
RPCServer();
explicit RPCServer(const Configuration::const_shared_pointer& conf = Configuration::const_shared_pointer());
virtual ~RPCServer();
@@ -66,6 +64,7 @@ public:
*/
void printInfo();
const std::tr1::shared_ptr<ServerContext>& getServer() const { return m_serverContext; }
};
epicsShareFunc Channel::shared_pointer createRPCChannel(ChannelProvider::shared_pointer const & provider,
+5 -2
View File
@@ -32,10 +32,13 @@ namespace pvAccess {
class epicsShareClass RPCRequestException : public std::runtime_error {
public:
explicit RPCRequestException(std::string const & message) :
std::runtime_error(message), m_status(epics::pvData::Status::STATUSTYPE_ERROR)
{}
RPCRequestException(epics::pvData::Status::StatusType status, std::string const & message) :
std::runtime_error(message), m_status(status)
{
}
{}
epics::pvData::Status::StatusType getStatus() const {
return m_status;
+2 -1
View File
@@ -477,11 +477,12 @@ string RPCChannelProvider::PROVIDER_NAME("rpcService");
Status RPCChannelProvider::noSuchChannelStatus(Status::STATUSTYPE_ERROR, "no such channel");
RPCServer::RPCServer()
RPCServer::RPCServer(const Configuration::const_shared_pointer &conf)
:m_channelProviderImpl(new RPCChannelProvider)
{
ChannelProvider::shared_pointer prov(new RPCChannelProvider);
m_serverContext = ServerContext::create(ServerContext::Config()
.config(conf)
.provider(m_channelProviderImpl));
}