Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Bind_Dispatcher_Guard.cpp
blob09a144d62f3c08907a714e5c8474e70badc8f64b
1 // -*- C++ -*-
2 #include "tao/Bind_Dispatcher_Guard.h"
4 #if !defined (__ACE_INLINE__)
5 # include "tao/Bind_Dispatcher_Guard.inl"
6 #endif /* ! __ACE_INLINE__ */
8 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
10 TAO_Bind_Dispatcher_Guard::TAO_Bind_Dispatcher_Guard (CORBA::ULong request_id,
11 TAO_Reply_Dispatcher *rd,
12 TAO_Transport_Mux_Strategy *tms)
13 : status_(TAO_Bind_Dispatcher_Guard::UNBIND),
14 request_id_(request_id),
15 tms_(tms)
17 int const retval =
18 this->tms_->bind_dispatcher (this->request_id_, rd);
20 if (retval == -1)
21 this->status_ = TAO_Bind_Dispatcher_Guard::NO_UNBIND;
24 TAO_Bind_Dispatcher_Guard::~TAO_Bind_Dispatcher_Guard ()
26 // We try unbinding. If it works it works, else cant do much about
27 // it..
28 if (this->status_ == TAO_Bind_Dispatcher_Guard::UNBIND)
29 (void)this->tms_->unbind_dispatcher (this->request_id_);
32 TAO_END_VERSIONED_NAMESPACE_DECL