The sequencer did not properly keep track of number of channels connected.
It now checks if it is actually connected/disconnect before it increments/decrements the counts.
This commit is contained in:
@@ -233,25 +233,35 @@ VOID seq_conn_handler(struct connection_handler_args args)
|
||||
/* Check for connected */
|
||||
if (ca_field_type(args.chid) == TYPENOTCONN)
|
||||
{
|
||||
pDB->connected = FALSE;
|
||||
pSP->connCount--;
|
||||
pDB->monitored = FALSE;
|
||||
#ifdef DEBUG
|
||||
logMsg("%s disconnected from %s\n", pDB->VarName, pDB->dbName);
|
||||
#endif /*DEBUG*/
|
||||
if(pDB->connected) {
|
||||
pDB->connected = FALSE;
|
||||
pSP->connCount--;
|
||||
pDB->monitored = FALSE;
|
||||
} else {
|
||||
printf("%s disconnected but already disconnected %s\n",
|
||||
pDB->pVarName,pDB->dbName);
|
||||
}
|
||||
}
|
||||
else /* PV connected */
|
||||
{
|
||||
pDB->connected = TRUE;
|
||||
pSP->connCount++;
|
||||
if (pDB->monFlag)
|
||||
pDB->monitored = TRUE;
|
||||
#ifdef DEBUG
|
||||
logMsg("%s connected to %s\n", pDB->VarName, pDB->dbName);
|
||||
#endif /*DEBUG*/
|
||||
pDB->dbCount = ca_element_count(args.chid);
|
||||
if (pDB->dbCount > pDB->count)
|
||||
pDB->dbCount = pDB->count;
|
||||
if(!pDB->connected) {
|
||||
pDB->connected = TRUE;
|
||||
pSP->connCount++;
|
||||
if (pDB->monFlag)
|
||||
pDB->monitored = TRUE;
|
||||
pDB->dbCount = ca_element_count(args.chid);
|
||||
if (pDB->dbCount > pDB->count)
|
||||
pDB->dbCount = pDB->count;
|
||||
} else {
|
||||
printf("%s connected but already connected %s\n",
|
||||
pDB->pVarName,pDB->dbName);
|
||||
}
|
||||
}
|
||||
|
||||
/* Wake up each state set that is waiting for event processing */
|
||||
|
||||
Reference in New Issue
Block a user