Skip to main content

Summary This article clarifies how to use TCP keep-alive in Orbix.
Environment

Orbix 6.3

All Supported Operating Systems

Question/Problem Description How to set TCP keep-alive in Orbix to maintain IIOP connections?
Clarifying Information

In some cases it is necessary to maintain IIOP connections and ensure idle connections are not being timed out. This is the case especially when communication between client and server goes through a firewall. Some firewalls drop idle connections after a specific time interval.

Ensure that the firewall, if it uses TCP idle connection timeouts, does never silently drop packets on timed out connections as this will lead to application hangs until the client side TCP times out, which can take several minutes. Meanwhile, the application will be not responding, seeming to have crashed.

Error Message
Defect/Enhancement Number
Cause
Resolution

The following configuration variable specifies the setting of SO_KEEPALIVE on sockets used to maintain IIOP connections.

plugins:iiop:tcp_connection:keep_alive

If set to TRUE, the socket will send a "keep-alive probe" to the remote host if the connection has been idle for a preset period of time. The remote system, if it is still running, will send an ACK response.


Defaults to TRUE.

Workaround
Notes

Note that the Orbix layer still depends on the TCP setting at OS level. The keep-alive probes will only be send after a preset period of time (TCP keep-alive time) which is defined at OS level.

In order to determine the TCP keep-alive time you can use the following depending on the underlying OS.

On Linux
Determine the TCP keep-alive time (in seconds) on your system, type:

cat /proc/sys/net/ipv4/tcp_keepalive_time

To set a different TCP keep-alive time (in seconds), type:

echo <sec> > /proc/sys/net/ipv4/tcp_keepalive_time

On Solaris
Determine the TCP keep-alive time (in milliseconds) on your system:

ndd /dev/tcp tcp_keepalive_interval

To change this value use ndd with the -set flag, e.g.:

ndd -set /dev/tcp tcp_keepalive_interval 1200000

On Windows
Determine the TCP keep-alive time (in milliseconds) on your system:

Run regedit and check/set the value for HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\KeepAliveTime

Attachment

#Orbix
#KnowledgeDocs