diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-10 22:59:49 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-10 22:59:49 +0000 |
commit | b5a84706882f4a2475918a5cd049b06195fdce5c (patch) | |
tree | c662fa7962bb076a045cd576777c2742d85a556a /TAO/orbsvcs | |
parent | 03a312a1fe990195a5999fef02a280cf31cfbba9 (diff) | |
download | ATCD-b5a84706882f4a2475918a5cd049b06195fdce5c.tar.gz |
ChangeLogTag: Thu Jul 10 18:58:43 2003 Irfan Pyarali <irfan@oomworks.com>
Diffstat (limited to 'TAO/orbsvcs')
3 files changed, 13 insertions, 27 deletions
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp index 6ad44c7d171..f7b4a637fbb 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp @@ -73,24 +73,6 @@ TAO_UIPMC_Acceptor::is_collocated (const TAO_Endpoint *) int TAO_UIPMC_Acceptor::close (void) { - // @@ Frank: Commented out since it seems like the reactor always is the one to - // remove the connection handler. -// if (this->connection_handler_) -// { -// // Remove the connection handler from the reactor in the case -// // of a valid handle, or close it yourself, if the handle is invalid. -// // Either way it will cause the connection handler to be destructed. -// if (this->connection_handler_->get_handle () != ACE_INVALID_HANDLE) -// { -// this->orb_core_->reactor ()->remove_handler (this->connection_handler_, -// ACE_Event_Handler::READ_MASK); -// } -// else -// { -// this->connection_handler_->handle_close (); -// } -// this->connection_handler_ = 0; -// } return 0; } @@ -193,19 +175,20 @@ TAO_UIPMC_Acceptor::open_i (const ACE_INET_Addr& addr, { ACE_NEW_RETURN (this->connection_handler_, TAO_UIPMC_Connection_Handler (this->orb_core_, - 0 /* TAO_UIPMC_Properties */), + 0 /* TAO_UIPMC_Properties */), -1); this->connection_handler_->local_addr (addr); this->connection_handler_->open_server (); + int result = + reactor->register_handler (this->connection_handler_, + ACE_Event_Handler::READ_MASK); + if (result == -1) + return result; - // Register only with a valid handle - if (this->connection_handler_->get_handle () != ACE_INVALID_HANDLE) - { - reactor->register_handler (this->connection_handler_, - ACE_Event_Handler::READ_MASK); - } + // Connection handler ownership now belongs to the Reactor. + this->connection_handler_->remove_reference (); // Set the port for each addr. If there is more than one network // interface then the endpoint created on each interface will be on diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp index 21e73eb6a08..7cf8dcd3b92 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp @@ -224,7 +224,11 @@ int TAO_UIPMC_Connection_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) { - ACE_ASSERT (0); + // No asserts here since the handler is registered with the Reactor + // and the handler ownership is given to the Reactor. When the + // Reactor closes, it will call handle_close() on the handler. It + // is however important to overwrite handle_close() to do nothing + // since the base class does too much. return 0; } diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp index 9b04d83c7bd..8afe68d659b 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp @@ -87,7 +87,6 @@ TAO_UIPMC_Transport::TAO_UIPMC_Transport (TAO_UIPMC_Connection_Handler *handler, TAO_UIPMC_Transport::~TAO_UIPMC_Transport (void) { - ACE_ASSERT(this->connection_handler_ == 0); delete this->messaging_object_; } |