diff --git a/src/ifmap/client/ifmap_channel.cc b/src/ifmap/client/ifmap_channel.cc index b922f346d38..03bda0eb15c 100644 --- a/src/ifmap/client/ifmap_channel.cc +++ b/src/ifmap/client/ifmap_channel.cc @@ -773,6 +773,16 @@ void IFMapChannel::SetArcSocketOptions() { ec.message()); } #endif + +#ifdef TCP_USER_TIMEOUT + boost::asio::detail::socket_option::integer + user_timeout_option(kSessionTcpUserTimeout); + arc_socket_->next_layer().set_option(user_timeout_option, ec); + if (ec) { + IFMAP_PEER_WARN(IFMapServerConnection, "Error setting user timeout", + ec.message()); + } +#endif } // The connection to the peer 'host_' has timed-out. Create a new entry for diff --git a/src/ifmap/client/ifmap_channel.h b/src/ifmap/client/ifmap_channel.h index 92c75d5a741..a6608594896 100644 --- a/src/ifmap/client/ifmap_channel.h +++ b/src/ifmap/client/ifmap_channel.h @@ -173,6 +173,7 @@ class IFMapChannel { static const int kSessionKeepaliveIdleTime = 30; // in seconds static const int kSessionKeepaliveInterval = 3; // in seconds static const int kSessionKeepaliveProbes = 5; // count + static const int kSessionTcpUserTimeout = 45000; // in milliseconds enum ResponseState { NONE = 0,