diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-07 23:58:34 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-07 23:58:34 +0000 |
commit | 81e0a245decc09943832d52cb9f419e3f8f355b7 (patch) | |
tree | 8aaf3418082d4c3b107e2f01eedf0d55095c7ec7 /TAO/tao/IIOP_Connection_Handler.cpp | |
parent | 784fe453b13e068e3ec273b9a0f4021ac5a51e96 (diff) | |
download | ATCD-81e0a245decc09943832d52cb9f419e3f8f355b7.tar.gz |
ChangeLogTag: Mon Jul 07 18:00:38 2003 Irfan Pyarali <irfan@oomworks.com>
Diffstat (limited to 'TAO/tao/IIOP_Connection_Handler.cpp')
-rw-r--r-- | TAO/tao/IIOP_Connection_Handler.cpp | 60 |
1 files changed, 45 insertions, 15 deletions
diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index 9ea68fc555f..46c61744cdb 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -34,7 +34,7 @@ TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (ACE_Thread_Manager *t) // Creation_Strategy requires a constructor with that signature, we // don't use that implementation, but some (most?) compilers // instantiate it anyway. - ACE_ASSERT (this->orb_core () != 0); + ACE_ASSERT (0); } @@ -54,7 +54,6 @@ TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler ( // store this pointer (indirectly increment ref count) this->transport (specific_transport); - TAO_Transport::release (specific_transport); } TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core, @@ -67,12 +66,11 @@ TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core { } - TAO_IIOP_Connection_Handler::~TAO_IIOP_Connection_Handler (void) { + delete this->transport (); } - int TAO_IIOP_Connection_Handler::open_handler (void *v) { @@ -134,7 +132,6 @@ TAO_IIOP_Connection_Handler::open (void*) return -1; } - if (TAO_debug_level > 0) { ACE_TCHAR client[MAXHOSTNAMELEN + 16]; @@ -158,10 +155,6 @@ TAO_IIOP_Connection_Handler::open (void*) return 0; } - - - - int TAO_IIOP_Connection_Handler::resume_handler (void) { @@ -177,26 +170,63 @@ TAO_IIOP_Connection_Handler::close_connection (void) int TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE h) { - return this->handle_input_eh (h, this); + int result = + this->handle_input_eh (h, this); + + if (result == -1) + { + this->close_connection (); + return 0; + } + + return result; } int TAO_IIOP_Connection_Handler::handle_output (ACE_HANDLE handle) { - return this->handle_output_eh (handle, this); + int result = + this->handle_output_eh (handle, this); + + if (result == -1) + { + this->close_connection (); + return 0; + } + + return result; +} + +int +TAO_IIOP_Connection_Handler::handle_timeout (const ACE_Time_Value &, + const void *) +{ + // We don't use this upcall for I/O. This is only used by the + // Connector to indicate that the connection timedout. Therefore, + // we should call close(). + return this->close (); } int -TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask rm) +TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE, + ACE_Reactor_Mask) { - return this->handle_close_eh (handle, rm, this); + ACE_ASSERT (0); + return 0; +} + +int +TAO_IIOP_Connection_Handler::close (u_long) +{ + this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED); + this->transport ()->remove_reference (); + return 0; } int TAO_IIOP_Connection_Handler::release_os_resources (void) { - return this->peer().close (); + return this->peer ().close (); } int |