diff --git a/pvAccessApp/remote/codec.cpp b/pvAccessApp/remote/codec.cpp index 88a1fcf..e01a8cb 100644 --- a/pvAccessApp/remote/codec.cpp +++ b/pvAccessApp/remote/codec.cpp @@ -199,16 +199,17 @@ namespace epics { { // handle response processApplicationMessage(); - postProcess = false; + + if (!isOpen()) + return; + + postProcess = false; postProcessApplicationMessage(); } - catch(...) //finally + catch(...) { if (postProcess) { - if (!isOpen()) - return; - postProcessApplicationMessage(); } @@ -230,9 +231,6 @@ namespace epics { void AbstractCodec::postProcessApplicationMessage() { - if (!isOpen()) - return; - // can be closed by now // isOpen() should be efficiently implemented while (true) @@ -1200,7 +1198,7 @@ namespace epics { BlockingAbstractCodec *bac = static_cast(param); Transport::shared_pointer ptr = bac->shared_from_this(); - + bac->setSenderThread(); while (bac->isOpen()) @@ -1232,7 +1230,7 @@ namespace epics { "YYYYYYYYYYYYYYYYYYYYYYYYYYYY (threadId: %u)", epicsThreadGetIdSelf()); - LOG(logLevelTrace, + LOG(logLevelTrace, "BlockingAbstractCodec::sendThread EXIIIIT (threadId: %u)", epicsThreadGetIdSelf()); @@ -1429,7 +1427,10 @@ namespace epics { int bytesRead = recv(_channel, (char*)(dst->getArray()+pos), remaining, 0); - + + // NOTE: do not log here, you might override SOCKERRNO relevant to recv() operation above + + /* LOG(logLevelTrace, "BlockingSocketAbstractCodec::read after recv, read: %d", bytesRead," (threadId: %u)", @@ -1440,6 +1441,7 @@ namespace epics { hexDump(std::string("READ"), (const int8 *)(dst->getArray()+pos), bytesRead); } + */ if(unlikely(bytesRead<=0)) { @@ -1447,6 +1449,11 @@ namespace epics { { int socketError = SOCKERRNO; + LOG(logLevelTrace, + "BlockingSocketAbstractCodec::read SOCKERRNO %d", socketError, + " (threadId: %u)", + epicsThreadGetIdSelf()); + // interrupted or timeout if (socketError == EINTR || socketError == EAGAIN || diff --git a/pvAccessApp/remoteClient/clientContextImpl.cpp b/pvAccessApp/remoteClient/clientContextImpl.cpp index ddd682c..9a162cb 100644 --- a/pvAccessApp/remoteClient/clientContextImpl.cpp +++ b/pvAccessApp/remoteClient/clientContextImpl.cpp @@ -4117,7 +4117,7 @@ TODO auto_ptr handler(new ClientResponseHandler(shared_from_this())); Transport::shared_pointer t = m_connector->connect(client, handler, *serverAddress, minorRevision, priority); // TODO !!! - static_pointer_cast(t)->setFlushStrategy(m_flushStrategy); + //static_pointer_cast(t)->setFlushStrategy(m_flushStrategy); return t; } catch (...)