diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index ae7f9d37c36..ddcbea13f11 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -552,17 +552,6 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) } assert(acm.timeout != IceUtil::Time()); - if(static_cast<Int>(_readStream.b.size()) > headerSize || !_writeStream.b.empty()) - { - // - // If writing or reading, nothing to do, the connection - // timeout will kick-in if writes or reads don't progress. - // This check is necessary because the actitivy timer is - // only set when a message is fully read/written. - // - return; - } - // // We send a heartbeat if there was no activity in the last // (timeout / 4) period. Sending a heartbeat sooner than really @@ -575,9 +564,8 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) // per timeout period because the monitor() method is sill only // called every (timeout / 2) period. // - if(acm.heartbeat == HeartbeatAlways || - (acm.heartbeat != HeartbeatOff && now >= (_acmLastActivity + acm.timeout / 4))) + (acm.heartbeat != HeartbeatOff && _writeStream.b.empty() && now >= (_acmLastActivity + acm.timeout / 4))) { if(acm.heartbeat != HeartbeatOnInvocation || _dispatchCount > 0) { @@ -585,6 +573,17 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) } } + if(static_cast<Int>(_readStream.b.size()) > headerSize || !_writeStream.b.empty()) + { + // + // If writing or reading, nothing to do, the connection + // timeout will kick-in if writes or reads don't progress. + // This check is necessary because the actitivy timer is + // only set when a message is fully read/written. + // + return; + } + if(acm.close != CloseOff && now >= (_acmLastActivity + acm.timeout)) { if(acm.close == CloseOnIdleForceful || |