From e2a40b1a547122b73db07b00b73ea4126dfebb82 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 28 Jun 2017 19:58:00 +0200 Subject: [PATCH] pva client fix getField --- src/remoteClient/clientContextImpl.cpp | 48 +++++++++++++++----------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/remoteClient/clientContextImpl.cpp b/src/remoteClient/clientContextImpl.cpp index a4f8476..1714523 100644 --- a/src/remoteClient/clientContextImpl.cpp +++ b/src/remoteClient/clientContextImpl.cpp @@ -3936,26 +3936,7 @@ public: * Resubscribe subscriptions. */ // TODO to be called from non-transport thread !!!!!! - void resubscribeSubscriptions() - { - Lock guard(m_responseRequestsMutex); - - Transport::shared_pointer transport = getTransport(); - - // NOTE: elements cannot be removed within rrs->updateSubscription callbacks - for (IOIDResponseRequestMap::iterator iter = m_responseRequests.begin(); - iter != m_responseRequests.end(); - iter++) - { - ResponseRequest::shared_pointer ptr = iter->second.lock(); - if (ptr) - { - SubscriptionRequest::shared_pointer rrs = dynamic_pointer_cast(ptr); - if (rrs) - EXCEPTION_GUARD(rrs->resubscribeSubscription(transport)); - } - } - } + void resubscribeSubscriptions(); /** * Update subscriptions. @@ -4788,7 +4769,7 @@ public: try { m_channel->checkAndGetTransport()->enqueueSendRequest(shared_from_this()); } catch (std::runtime_error &rte) { - notify(BaseRequestImpl::channelNotConnected, FieldConstPtr()); + //notify(BaseRequestImpl::channelNotConnected, FieldConstPtr()); } } @@ -4895,6 +4876,31 @@ void InternalClientContextImpl::InternalChannelImpl::getField(GetFieldRequester: // activate() stores self in channel } +void InternalClientContextImpl::InternalChannelImpl::resubscribeSubscriptions() +{ + Lock guard(m_responseRequestsMutex); + + Transport::shared_pointer transport = getTransport(); + + if(m_getfield) { + transport->enqueueSendRequest(m_getfield); + } + + // NOTE: elements cannot be removed within rrs->updateSubscription callbacks + for (IOIDResponseRequestMap::iterator iter = m_responseRequests.begin(); + iter != m_responseRequests.end(); + iter++) + { + ResponseRequest::shared_pointer ptr = iter->second.lock(); + if (ptr) + { + SubscriptionRequest::shared_pointer rrs = dynamic_pointer_cast(ptr); + if (rrs) + EXCEPTION_GUARD(rrs->resubscribeSubscription(transport)); + } + } +} + }//namespace namespace epics { namespace pvAccess {