diff options
Diffstat (limited to 'TAO/tao/UIOP_Acceptor.cpp')
-rw-r--r-- | TAO/tao/UIOP_Acceptor.cpp | 72 |
1 files changed, 15 insertions, 57 deletions
diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp index b62478db05c..1b10f6fa294 100644 --- a/TAO/tao/UIOP_Acceptor.cpp +++ b/TAO/tao/UIOP_Acceptor.cpp @@ -18,15 +18,14 @@ // // ============================================================================ -#include "tao/UIOP_Acceptor.h" - #if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) +#include "tao/UIOP_Acceptor.h" #include "tao/UIOP_Profile.h" #include "tao/MProfile.h" #include "tao/ORB_Core.h" -#include "tao/GIOP.h" #include "tao/Server_Strategy_Factory.h" +#include "tao/GIOP.h" #include "tao/debug.h" ACE_RCSID(tao, UIOP_Acceptor, "$Id$") @@ -36,20 +35,17 @@ ACE_RCSID(tao, UIOP_Acceptor, "$Id$") TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void) : TAO_Acceptor (TAO_IOP_TAG_UNIX_IOP), base_acceptor_ (), - creation_strategy_ (0), - concurrency_strategy_ (0), - accept_strategy_ (0), version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR), - orb_core_ (0), - unlink_on_close_ (1) + orb_core_ (0) { } TAO_UIOP_Acceptor::~TAO_UIOP_Acceptor (void) { - delete this->creation_strategy_; - delete this->concurrency_strategy_; - delete this->accept_strategy_; + // Explicitly call close() to aid in post-error resource clean up. + // close() is called to ensure that the rendezvous point is removed + // from the filesystem. + this->close (); } int @@ -58,7 +54,7 @@ TAO_UIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, { ACE_UNIX_Addr addr; - if (this->base_acceptor_.acceptor ().get_local_addr (addr) == -1) + if (base_acceptor_.acceptor ().get_local_addr (addr) == -1) return 0; // we only make one @@ -69,7 +65,7 @@ TAO_UIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, return -1; } - TAO_UIOP_Profile *pfile = 0; + TAO_UIOP_Profile *pfile; ACE_NEW_RETURN (pfile, TAO_UIOP_Profile (addr, object_key, @@ -118,11 +114,10 @@ TAO_UIOP_Acceptor::close (void) { ACE_UNIX_Addr addr; - if (this->base_acceptor_.acceptor ().get_local_addr (addr) == -1) + if (base_acceptor_.acceptor ().get_local_addr (addr) == -1) return -1; - if (this->unlink_on_close_) - (void) ACE_OS::unlink (addr.get_path_name ()); + (void) ACE_OS::unlink (addr.get_path_name ()); return this->base_acceptor_.close (); } @@ -157,35 +152,12 @@ TAO_UIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, { this->orb_core_ = orb_core; - ACE_NEW_RETURN (this->creation_strategy_, - TAO_UIOP_CREATION_STRATEGY (this->orb_core_), - -1); - - ACE_NEW_RETURN (this->concurrency_strategy_, - TAO_UIOP_CONCURRENCY_STRATEGY (this->orb_core_), - -1); - - ACE_NEW_RETURN (this->accept_strategy_, - TAO_UIOP_ACCEPT_STRATEGY (this->orb_core_), - -1); - ACE_UNIX_Addr addr; this->rendezvous_point (addr, rendezvous); - if (this->base_acceptor_.open (addr, - this->orb_core_->reactor (), - this->creation_strategy_, - this->accept_strategy_, - this->concurrency_strategy_) == -1) - { - // Don't unlink an existing rendezvous point since it may be in - // use by another UIOP server/client. - if (errno == EADDRINUSE) - this->unlink_on_close_ = 0; - - return -1; - } + if (this->base_acceptor_.open (orb_core, addr) != 0) + return -1; // @@ If Profile creation is slow we may need to cache the // rendezvous point here @@ -255,26 +227,12 @@ TAO_UIOP_Acceptor::endpoint_count (void) #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class TAO_Acceptor_Impl<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate TAO_Acceptor_Impl<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |