diff --git a/src/ca/baseNMIU.cpp b/src/ca/baseNMIU.cpp index 3f6c131a6..b3f161ac6 100644 --- a/src/ca/baseNMIU.cpp +++ b/src/ca/baseNMIU.cpp @@ -29,5 +29,11 @@ baseNMIU::~baseNMIU () { } +void baseNMIU::forceSubscriptionUpdate ( + epicsGuard < epicsMutex > & guard, nciu & chan ) +{ +} + + diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index 2e1254766..b26ee68cc 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -560,17 +560,13 @@ void nciu::sendSubscriptionUpdateRequests ( epicsGuard < epicsMutex > & guard ) while ( pNetIO.valid () ) { tsDLIter < baseNMIU > next = pNetIO; next++; - class netSubscription * pSubscr = pNetIO->isSubscription (); - // the channel becomes connected while subscription update requests - // are pending so IO types other than subscription IO might be attached - if ( pSubscr ) { - try { - pSubscr->subscriptionUpdateIfRequired ( guard, *this ); - } - catch ( ... ) { - errlogPrintf ( "CAC: failed to send subscription update request " - "during channel connect\n" ); - } + try { + pNetIO->forceSubscriptionUpdate ( guard, *this ); + } + catch ( ... ) { + errlogPrintf ( + "CAC: failed to send subscription update request " + "during channel connect\n" ); } pNetIO = next; } diff --git a/src/ca/netIO.h b/src/ca/netIO.h index 75a3a21e5..12e9a7169 100644 --- a/src/ca/netIO.h +++ b/src/ca/netIO.h @@ -61,6 +61,8 @@ public: epicsGuard < epicsMutex > &, cacRecycle &, unsigned type, arrayElementCount count, const void * pData ) = 0; + virtual void forceSubscriptionUpdate ( + epicsGuard < epicsMutex > & guard, nciu & chan ) = 0; virtual class netSubscription * isSubscription () = 0; virtual void show ( unsigned level ) const = 0; @@ -91,8 +93,6 @@ public: epicsGuard < epicsMutex > & guard, nciu & chan ); void unsubscribeIfRequired ( epicsGuard < epicsMutex > & guard, nciu & chan ); - void subscriptionUpdateIfRequired ( - epicsGuard < epicsMutex > &, nciu & ); protected: netSubscription ( class privateInterfaceForIO &, unsigned type, @@ -105,7 +105,6 @@ private: cacStateNotify & notify; const unsigned type; const unsigned mask; - bool updateWhileDisconnected; bool subscribed; class netSubscription * isSubscription (); void * operator new ( size_t ); @@ -128,6 +127,8 @@ private: epicsGuard < epicsMutex > &, cacRecycle &, int status, const char * pContext, unsigned type, arrayElementCount count ); + void forceSubscriptionUpdate ( + epicsGuard < epicsMutex > & guard, nciu & chan ); netSubscription ( const netSubscription & ); netSubscription & operator = ( const netSubscription & ); }; @@ -169,6 +170,8 @@ private: int status, const char * pContext, unsigned type, arrayElementCount count ); class netSubscription * isSubscription (); + void forceSubscriptionUpdate ( + epicsGuard < epicsMutex > & guard, nciu & chan ); netReadNotifyIO ( const netReadNotifyIO & ); netReadNotifyIO & operator = ( const netReadNotifyIO & ); }; @@ -210,6 +213,8 @@ private: epicsGuard < epicsMutex > &, cacRecycle &, int status, const char * pContext, unsigned type, arrayElementCount count ); + void forceSubscriptionUpdate ( + epicsGuard < epicsMutex > & guard, nciu & chan ); netWriteNotifyIO ( const netWriteNotifyIO & ); netWriteNotifyIO & operator = ( const netWriteNotifyIO & ); }; diff --git a/src/ca/netReadNotifyIO.cpp b/src/ca/netReadNotifyIO.cpp index 3da905f8b..08c0e2655 100644 --- a/src/ca/netReadNotifyIO.cpp +++ b/src/ca/netReadNotifyIO.cpp @@ -113,6 +113,11 @@ class netSubscription * netReadNotifyIO::isSubscription () return 0; } +void netReadNotifyIO::forceSubscriptionUpdate ( + epicsGuard < epicsMutex > &, nciu & ) +{ +} + void * netReadNotifyIO::operator new ( size_t ) // X aCC 361 { // The HPUX compiler seems to require this even though no code diff --git a/src/ca/netSubscription.cpp b/src/ca/netSubscription.cpp index dd902477f..a9275d95e 100644 --- a/src/ca/netSubscription.cpp +++ b/src/ca/netSubscription.cpp @@ -37,7 +37,7 @@ netSubscription::netSubscription ( unsigned maskIn, cacStateNotify & notifyIn ) : count ( countIn ), privateChanForIO ( chanIn ), notify ( notifyIn ), type ( typeIn ), mask ( maskIn ), - updateWhileDisconnected ( false ), subscribed ( false ) + subscribed ( false ) { if ( ! dbr_type_is_valid ( typeIn ) ) { throw cacChannel::badType (); @@ -80,12 +80,6 @@ void netSubscription::show ( void netSubscription::completion ( epicsGuard < epicsMutex > & guard, cacRecycle & ) { - if ( this->privateChanForIO.connected ( guard ) ) { - this->updateWhileDisconnected = false; - } - else { - this->updateWhileDisconnected = true; - } errlogPrintf ( "subscription update w/o data ?\n" ); } @@ -106,13 +100,9 @@ void netSubscription::exception ( else { // guard.assertIdenticalMutex ( this->mutex ); if ( this->privateChanForIO.connected ( guard ) ) { - this->updateWhileDisconnected = false; this->notify.exception ( guard, status, pContext, UINT_MAX, 0 ); } - else { - this->updateWhileDisconnected = true; - } } } @@ -134,13 +124,9 @@ void netSubscription::exception ( else { //guard.assertIdenticalMutex ( this->mutex ); if ( this->privateChanForIO.connected ( guard ) ) { - this->updateWhileDisconnected = false; this->notify.exception ( guard, status, pContext, typeIn, countIn ); } - else { - this->updateWhileDisconnected = true; - } } } @@ -151,13 +137,9 @@ void netSubscription::completion ( { // guard.assertIdenticalMutex ( this->mutex ); if ( this->privateChanForIO.connected ( guard ) ) { - this->updateWhileDisconnected = false; this->notify.current ( guard, typeIn, countIn, pDataIn ); } - else { - this->updateWhileDisconnected = true; - } } void netSubscription::subscribeIfRequired ( @@ -180,14 +162,11 @@ void netSubscription::unsubscribeIfRequired ( } } -void netSubscription::subscriptionUpdateIfRequired ( +void netSubscription::forceSubscriptionUpdate ( epicsGuard < epicsMutex > & guard, nciu & chan ) { - if ( this->updateWhileDisconnected ) { - chan.getPIIU(guard)->subscriptionUpdateRequest ( - guard, chan, *this ); - this->updateWhileDisconnected = false; - } + chan.getPIIU(guard)->subscriptionUpdateRequest ( + guard, chan, *this ); } void * netSubscription::operator new ( size_t ) // X aCC 361 diff --git a/src/ca/netWriteNotifyIO.cpp b/src/ca/netWriteNotifyIO.cpp index fe4986d5d..566d40a5f 100644 --- a/src/ca/netWriteNotifyIO.cpp +++ b/src/ca/netWriteNotifyIO.cpp @@ -111,6 +111,11 @@ class netSubscription * netWriteNotifyIO::isSubscription () return 0; } +void netWriteNotifyIO::forceSubscriptionUpdate ( + epicsGuard < epicsMutex > &, nciu & ) +{ +} + void * netWriteNotifyIO::operator new ( size_t ) // X aCC 361 { // The HPUX compiler seems to require this even though no code