summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Connection.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-12-12 16:43:55 +0000
committerMarc Laukien <marc@zeroc.com>2003-12-12 16:43:55 +0000
commitbe72389924fa605eb2fb3b8eadb3a0fdab96a5f9 (patch)
tree040fb2314449de17d7069674565432d38fe7b5dc /cpp/src/Ice/Connection.cpp
parentfixes (diff)
downloadice-be72389924fa605eb2fb3b8eadb3a0fdab96a5f9.tar.bz2
ice-be72389924fa605eb2fb3b8eadb3a0fdab96a5f9.tar.xz
ice-be72389924fa605eb2fb3b8eadb3a0fdab96a5f9.zip
fixes
Diffstat (limited to 'cpp/src/Ice/Connection.cpp')
-rw-r--r--cpp/src/Ice/Connection.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index ca9710cc6b7..00e1ae04a95 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -1294,8 +1294,10 @@ IceInternal::Connection::message(BasicStream& stream, const ThreadPoolPtr& threa
void
IceInternal::Connection::finished(const ThreadPoolPtr& threadPool)
{
- std::map<Ice::Int, Outgoing*> requests;
- std::map<Ice::Int, OutgoingAsyncPtr> asyncRequests;
+ auto_ptr<LocalException> closeException;
+
+ map<Int, Outgoing*> requests;
+ map<Int, OutgoingAsyncPtr> asyncRequests;
{
IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);
@@ -1308,12 +1310,21 @@ IceInternal::Connection::finished(const ThreadPoolPtr& threadPool)
}
else if(_state == StateClosed && _transceiver)
{
- _transceiver->close();
+ try
+ {
+ _transceiver->close();
+ }
+ catch(const LocalException& ex)
+ {
+ closeException = auto_ptr<LocalException>(dynamic_cast<LocalException*>(ex.ice_clone()));
+ }
+
{
// See _queryMutex comment in header file.
IceUtil::Mutex::Lock s(_queryMutex);
_transceiver = 0;
}
+
_threadPool = 0; // We don't need the thread pool anymore.
notifyAll();
}
@@ -1337,6 +1348,11 @@ IceInternal::Connection::finished(const ThreadPoolPtr& threadPool)
{
q->second->__finished(*_exception.get()); // Exception is immutable at this point.
}
+
+ if(closeException.get())
+ {
+ closeException->ice_throw();
+ }
}
void
@@ -1599,12 +1615,22 @@ IceInternal::Connection::setState(State state)
if(_state == StateNotValidated)
{
assert(!_registeredWithPool);
- _transceiver->close();
+
+ try
+ {
+ _transceiver->close();
+ }
+ catch(const LocalException&)
+ {
+ // Here we ignore any exceptions in close().
+ }
+
{
// See _queryMutex comment in header file.
IceUtil::Mutex::Lock sync(_queryMutex);
_transceiver = 0;
}
+
_threadPool = 0; // We don't need the thread pool anymore.
}
else