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