summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_Connection_Handler.cpp
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-03-21 12:56:50 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-03-21 12:56:50 +0000
commit6347ce201ccff01bd009ca66a7b2b56eb2a03f96 (patch)
tree9db30145c04243285568226114e366784ba0755f /TAO/tao/IIOP_Connection_Handler.cpp
parent2d45ea1ff89d75c23732bddc8de062966fa3965e (diff)
downloadATCD-6347ce201ccff01bd009ca66a7b2b56eb2a03f96.tar.gz
ChangeLogTag: Mon Mar 21 06:56:10 2005 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tao/IIOP_Connection_Handler.cpp')
-rw-r--r--TAO/tao/IIOP_Connection_Handler.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp
index 4069f433e2c..ed6e0d1d808 100644
--- a/TAO/tao/IIOP_Connection_Handler.cpp
+++ b/TAO/tao/IIOP_Connection_Handler.cpp
@@ -199,6 +199,30 @@ TAO_IIOP_Connection_Handler::resume_handler (void)
int
TAO_IIOP_Connection_Handler::close_connection (void)
{
+ // To maintain maximum compatibility, we only set this socket option
+ // if the user has provided a linger timeout.
+ int linger = this->orb_core()->orb_params()->linger ();
+ if (linger != -1)
+ {
+ struct linger lval;
+ lval.l_onoff = 1;
+ lval.l_linger = linger;
+
+ if (this->peer ().set_option(SOL_SOCKET,
+ SO_LINGER,
+ (void*) &lval,
+ sizeof (lval)) == -1)
+ {
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("TAO (%P|%t) Unable to set ")
+ ACE_LIB_TEXT ("SO_LINGER on %d\n"),
+ this->peer ().get_handle ()));
+ }
+ }
+ }
+
return this->close_connection_eh (this);
}