diff --git a/src/pva/pvaVersion.h b/src/pva/pvaVersion.h index 9824312..8714ef0 100644 --- a/src/pva/pvaVersion.h +++ b/src/pva/pvaVersion.h @@ -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 { diff --git a/src/remoteClient/clientContextImpl.cpp b/src/remoteClient/clientContextImpl.cpp index ffe72bb..b45eb1e 100644 --- a/src/remoteClient/clientContextImpl.cpp +++ b/src/remoteClient/clientContextImpl.cpp @@ -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; } } } diff --git a/src/rpcClient/rpcClient.cpp b/src/rpcClient/rpcClient.cpp index e2db2fb..329ac2c 100644 --- a/src/rpcClient/rpcClient.cpp +++ b/src/rpcClient/rpcClient.cpp @@ -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 channelRequesterImpl(new ChannelAndRPCRequesterImpl()); + shared_ptr 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, diff --git a/src/rpcClient/rpcClient.h b/src/rpcClient/rpcClient.h index f38e53d..89a1d59 100644 --- a/src/rpcClient/rpcClient.h +++ b/src/rpcClient/rpcClient.h @@ -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; }; }