summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Outgoing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Outgoing.cpp')
-rw-r--r--cpp/src/Ice/Outgoing.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp
index a136e2f3b38..23fc92af5df 100644
--- a/cpp/src/Ice/Outgoing.cpp
+++ b/cpp/src/Ice/Outgoing.cpp
@@ -17,9 +17,12 @@
#include <Ice/Protocol.h>
#include <Ice/Instance.h>
#include <Ice/ReplyStatus.h>
+#include <Ice/Observer.h>
+#include <Ice/ProxyFactory.h>
using namespace std;
using namespace Ice;
+using namespace Ice::Instrumentation;
using namespace IceInternal;
IceInternal::LocalExceptionWrapper::LocalExceptionWrapper(const LocalException& ex, bool r) :
@@ -81,8 +84,9 @@ IceInternal::LocalExceptionWrapper::retry() const
}
IceInternal::Outgoing::Outgoing(RequestHandler* handler, const string& operation, OperationMode mode,
- const Context* context) :
+ const Context* context, InvocationObserver& observer) :
_handler(handler),
+ _observer(observer),
_state(StateUnsent),
_encoding(handler->getReference()->getEncoding()),
_is(handler->getReference()->getInstance().get(), Ice::currentProtocolEncoding),
@@ -158,6 +162,10 @@ IceInternal::Outgoing::Outgoing(RequestHandler* handler, const string& operation
}
}
+Outgoing::~Outgoing()
+{
+}
+
bool
IceInternal::Outgoing::invoke()
{
@@ -349,6 +357,11 @@ IceInternal::Outgoing::sent(bool notify)
//
_sent = true;
}
+
+ if(_handler->getReference()->getMode() != Reference::ModeTwoway)
+ {
+ _remoteObserver.detach();
+ }
}
void
@@ -359,6 +372,7 @@ IceInternal::Outgoing::finished(BasicStream& is)
assert(_handler->getReference()->getMode() == Reference::ModeTwoway); // Can only be called for twoways.
assert(_state <= StateInProgress);
+ _remoteObserver.detach();
_is.swap(is);
Byte replyStatus;
@@ -510,6 +524,8 @@ IceInternal::Outgoing::finished(const LocalException& ex, bool sent)
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor);
assert(_state <= StateInProgress);
+ _remoteObserver.detach();
+
_state = StateFailed;
_exception.reset(ex.ice_clone());
_sent = sent;