diff options
author | Marc Laukien <marc@zeroc.com> | 2003-09-26 20:21:03 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-09-26 20:21:03 +0000 |
commit | 05740d83942c90764ddf9825c8abcd14069617a4 (patch) | |
tree | e9d93698bc71dac7a0871edf1f8f1cdccfb393b4 /cpp/src | |
parent | Fixed minor bugs (diff) | |
download | ice-05740d83942c90764ddf9825c8abcd14069617a4.tar.bz2 ice-05740d83942c90764ddf9825c8abcd14069617a4.tar.xz ice-05740d83942c90764ddf9825c8abcd14069617a4.zip |
fix
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 1d6227ecd81..12bd9493791 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -384,6 +384,7 @@ void IceInternal::OutgoingConnectionFactory::flushBatchRequests() { list<ConnectionPtr> c; + { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); @@ -394,7 +395,18 @@ IceInternal::OutgoingConnectionFactory::flushBatchRequests() c.push_back(p->second); } } - for_each(c.begin(), c.end(), Ice::voidMemFun(&Connection::flushBatchRequest)); + + for(list<ConnectionPtr>::const_iterator p = c.begin(); p != c.end(); ++p) + { + try + { + (*p)->flushBatchRequest(); + } + catch(const LocalException&) + { + // Ignore. + } + } } IceInternal::OutgoingConnectionFactory::OutgoingConnectionFactory(const InstancePtr& instance) : @@ -510,26 +522,25 @@ IceInternal::IncomingConnectionFactory::connections() const return result; } -namespace IceInternal { - -struct FlushIfValidated +void +IceInternal::IncomingConnectionFactory::flushBatchRequests() { - void operator() (ConnectionPtr p) + list<ConnectionPtr> c = connections(); // connections() is synchronized, so no need to synchronize here. + + for(list<ConnectionPtr>::const_iterator p = c.begin(); p != c.end(); ++p) { - if(p->isValidated()) + if((*p)->isValidated()) { - p->flushBatchRequest(); + try + { + (*p)->flushBatchRequest(); + } + catch(const LocalException&) + { + // Ignore. + } } } -}; - -} - -void -IceInternal::IncomingConnectionFactory::flushBatchRequests() -{ - list<ConnectionPtr> c = connections(); // connections() is synchronized, so no need to synchronize here. - for_each(c.begin(), c.end(), FlushIfValidated()); } bool |