This commit is contained in:
mrkraimer
2015-12-16 07:37:02 -05:00
4 changed files with 36 additions and 14 deletions

View File

@@ -25,8 +25,8 @@
// module version
// TODO to be generated, etc.
#define EPICS_PVA_MAJOR_VERSION 4
#define EPICS_PVA_MINOR_VERSION 1
#define EPICS_PVA_MAINTENANCE_VERSION 2
#define EPICS_PVA_MINOR_VERSION 2
#define EPICS_PVA_MAINTENANCE_VERSION 0
#define EPICS_PVA_DEVELOPMENT_FLAG 1
namespace epics {

View File

@@ -2431,7 +2431,7 @@ namespace epics {
ss << pvString->get();
ss >> size;
if (size > 0)
m_ackAny = size;
m_ackAny = (m_ackAny <= m_queueSize) ? size : m_queueSize;
}
}
}

View File

@@ -44,9 +44,14 @@ class ChannelAndRPCRequesterImpl :
Status m_status;
PVStructure::shared_pointer m_response;
ChannelRPC::shared_pointer m_channelRPC;
PVStructure::shared_pointer m_pvRequest;
public:
ChannelAndRPCRequesterImpl() {}
ChannelAndRPCRequesterImpl(PVStructure::shared_pointer const & pvRequest)
: m_pvRequest(pvRequest)
{
}
virtual string getRequesterName()
{
@@ -96,9 +101,7 @@ class ChannelAndRPCRequesterImpl :
if (!rpcAlreadyConnectedOnce)
{
PVStructure::shared_pointer pvRequest =
CreateRequest::create()->createRequest("");
channel->createChannelRPC(shared_from_this(), pvRequest);
channel->createChannelRPC(shared_from_this(), m_pvRequest);
}
}
/*
@@ -216,8 +219,9 @@ class ChannelAndRPCRequesterImpl :
RPCClient::RPCClient(const std::string & serviceName)
: m_serviceName(serviceName)
RPCClient::RPCClient(const std::string & serviceName,
PVStructure::shared_pointer const & pvRequest)
: m_serviceName(serviceName), m_pvRequest(pvRequest)
{
}
@@ -245,7 +249,7 @@ void RPCClient::issueConnect()
ChannelProvider::shared_pointer provider = getChannelProviderRegistry()->getProvider("pva");
// TODO try to reuse ChannelRequesterImpl instance (i.e. create only once)
shared_ptr<ChannelAndRPCRequesterImpl> channelRequesterImpl(new ChannelAndRPCRequesterImpl());
shared_ptr<ChannelAndRPCRequesterImpl> channelRequesterImpl(new ChannelAndRPCRequesterImpl(m_pvRequest));
m_channel = provider->createChannel(m_serviceName, channelRequesterImpl);
}
@@ -315,11 +319,17 @@ PVStructure::shared_pointer RPCClient::waitResponse(double timeout)
RPCClient::shared_pointer RPCClient::create(const std::string & serviceName)
{
ClientFactory::start();
return RPCClient::shared_pointer(new RPCClient(serviceName));
PVStructure::shared_pointer pvRequest =
CreateRequest::create()->createRequest("");
return create(serviceName, pvRequest);
}
RPCClient::shared_pointer RPCClient::create(const std::string & serviceName,
PVStructure::shared_pointer const & pvRequest)
{
ClientFactory::start();
return RPCClient::shared_pointer(new RPCClient(serviceName, pvRequest));
}
PVStructure::shared_pointer RPCClient::sendRequest(const std::string & serviceName,
PVStructure::shared_pointer const & queryRequest,

View File

@@ -48,6 +48,16 @@ namespace pvAccess
*/
static shared_pointer create(const std::string & serviceName);
/**
* Create a RPCClient.
*
* @param serviceName the service name
* @param pvRequest the pvRequest for the ChannelRPC
* @return the RPCClient interface
*/
static shared_pointer create(const std::string & serviceName,
epics::pvData::PVStructure::shared_pointer const & pvRequest);
/**
* Performs complete blocking RPC call, opening a channel and connecting to the
* service and sending the request.
@@ -129,10 +139,12 @@ namespace pvAccess
virtual ~RPCClient() {}
protected:
RPCClient(const std::string & serviceName);
RPCClient(const std::string & serviceName,
epics::pvData::PVStructure::shared_pointer const & pvRequest);
std::string m_serviceName;
Channel::shared_pointer m_channel;
epics::pvData::PVStructure::shared_pointer m_pvRequest;
};
}