fix bug that causes failure in monotor::stop for privider ca

This commit is contained in:
mrkraimer
2018-07-27 05:43:47 -04:00
parent 4e4554af4e
commit b7ea0fe59a
5 changed files with 10 additions and 26 deletions

View File

@@ -1185,7 +1185,7 @@ private:
PvaClientChannelPtr const & pvaClientChannel,
epics::pvData::PVStructurePtr const &pvRequest);
void checkGetState();
void checkConnectState();
enum GetConnectState {connectIdle,connectActive,connected};
PvaClient::weak_pointer pvaClient;
@@ -1354,7 +1354,7 @@ private :
PvaClientChannelPtr const & pvaClientChannel,
epics::pvData::PVStructurePtr const &pvRequest);
void checkPutState();
void checkConnectState();
enum PutConnectState {connectIdle,connectActive,connected};
PvaClient::weak_pointer pvaClient;

View File

@@ -198,7 +198,6 @@ void PvaClientChannel::channelStateChange(
<< " " << Channel::ConnectionStateNames[connectionState]
<< endl;
}
bool waitingForConnect = false;
if(connectState==connectActive) waitingForConnect = true;
if(connectionState!=Channel::CONNECTED) {

View File

@@ -115,16 +115,16 @@ PvaClientGet::~PvaClientGet()
}
void PvaClientGet::checkGetState()
void PvaClientGet::checkConnectState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientGet::checkGetState"
cout << "PvaClientGet::checkConnectState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!pvaClientChannel->getChannel()->isConnected()) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientGet::checkGetState channel not connected ";
+ " PvaClientGet::checkConnectState channel not connected ";
throw std::runtime_error(message);
}
if(connectState==connectIdle) {
@@ -334,7 +334,7 @@ PvaClientGetDataPtr PvaClientGet::getData()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
checkGetState();
checkConnectState();
if(getState==getIdle) get();
return pvaClientData;
}

View File

@@ -436,16 +436,6 @@ bool PvaClientMonitor::poll()
<< endl;
}
checkMonitorState();
if(!isStarted) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::poll illegal state ";
throw std::runtime_error(message);
}
if(userPoll) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::poll did not release last";
throw std::runtime_error(message);
}
monitorElement = monitor->poll();
if(!monitorElement) return false;
userPoll = true;
@@ -483,11 +473,6 @@ void PvaClientMonitor::releaseEvent()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!isStarted) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::releaseEvent monitor not started ";
throw std::runtime_error(message);
}
if(!userPoll) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::releaseEvent did not call poll";

View File

@@ -119,10 +119,10 @@ PvaClientPut::~PvaClientPut()
}
void PvaClientPut::checkPutState()
void PvaClientPut::checkConnectState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientPut::checkPutState"
cout << "PvaClientPut::checkConnectState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
@@ -385,7 +385,7 @@ void PvaClientPut::issuePut()
if(putState==getActive || putState==putActive) {
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ "PvaClientPut::issueGet get or put aleady active ";
+ "PvaClientPut::issuePut get or put aleady active ";
throw std::runtime_error(message);
}
putState = putActive;
@@ -421,7 +421,7 @@ PvaClientPutDataPtr PvaClientPut::getData()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
checkPutState();
checkConnectState();
if(putState==putIdle) get();
return pvaClientData;
}