00001 // This may look like C, but it's really -*- C++ -*- 00002 // $Id: Bind_Dispatcher_Guard.cpp 82593 2008-08-11 15:39:24Z johnnyw $ 00003 00004 #include "tao/Bind_Dispatcher_Guard.h" 00005 00006 #if !defined (__ACE_INLINE__) 00007 # include "tao/Bind_Dispatcher_Guard.inl" 00008 #endif /* ! __ACE_INLINE__ */ 00009 00010 ACE_RCSID (tao, 00011 Bind_Dispatcher_Guard, 00012 "$Id: Bind_Dispatcher_Guard.cpp 82593 2008-08-11 15:39:24Z johnnyw $") 00013 00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00015 00016 TAO_Bind_Dispatcher_Guard::TAO_Bind_Dispatcher_Guard (CORBA::ULong request_id, 00017 TAO_Reply_Dispatcher *rd, 00018 TAO_Transport_Mux_Strategy *tms) 00019 : status_(TAO_Bind_Dispatcher_Guard::UNBIND), 00020 request_id_(request_id), 00021 tms_(tms) 00022 { 00023 int const retval = 00024 this->tms_->bind_dispatcher (this->request_id_, rd); 00025 00026 if (retval == -1) 00027 this->status_ = TAO_Bind_Dispatcher_Guard::NO_UNBIND; 00028 } 00029 00030 TAO_Bind_Dispatcher_Guard::~TAO_Bind_Dispatcher_Guard (void) 00031 { 00032 // We try unbinding. If it works it works, else cant do much about 00033 // it.. 00034 if (this->status_ == TAO_Bind_Dispatcher_Guard::UNBIND) 00035 (void)this->tms_->unbind_dispatcher (this->request_id_); 00036 } 00037 00038 TAO_END_VERSIONED_NAMESPACE_DECL