add RPC loopback test
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user