00001 //$Id: Thread_Per_Connection_Handler.cpp 80114 2007-11-27 15:56:54Z johnnyw $ 00002 #include "tao/Thread_Per_Connection_Handler.h" 00003 #include "tao/Connection_Handler.h" 00004 #include "tao/debug.h" 00005 #include "tao/Transport.h" 00006 #include "tao/ORB_Core.h" 00007 #include "ace/Flag_Manip.h" 00008 00009 ACE_RCSID (tao, 00010 Thread_Per_Connection_Handler, 00011 "$Id: Thread_Per_Connection_Handler.cpp 80114 2007-11-27 15:56:54Z johnnyw $") 00012 00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 TAO_Thread_Per_Connection_Handler::TAO_Thread_Per_Connection_Handler ( 00016 TAO_Connection_Handler *ch, 00017 TAO_ORB_Core *oc) 00018 : ACE_Task_Base (oc->thr_mgr ()) 00019 , ch_ (ch) 00020 { 00021 this->ch_->transport ()->add_reference (); 00022 } 00023 00024 TAO_Thread_Per_Connection_Handler::~TAO_Thread_Per_Connection_Handler (void) 00025 { 00026 this->ch_->close_connection (); 00027 this->ch_->transport ()->remove_reference (); 00028 } 00029 00030 int 00031 TAO_Thread_Per_Connection_Handler::svc (void) 00032 { 00033 ACE::clr_flags (this->ch_->transport ()->event_handler_i ()->get_handle (), 00034 ACE_NONBLOCK); 00035 00036 // Call the implementation here 00037 return this->ch_->svc_i (); 00038 } 00039 00040 int 00041 TAO_Thread_Per_Connection_Handler::open (void*v) 00042 { 00043 return this->ch_->open_handler (v); 00044 } 00045 00046 int 00047 TAO_Thread_Per_Connection_Handler::close (u_long) 00048 { 00049 delete this; 00050 00051 return 0; 00052 } 00053 00054 TAO_END_VERSIONED_NAMESPACE_DECL