Kbase P3523: TCP port remains in use forever when the socket client has disappeared
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/18/2006 |
|
Status: Verified
FACT(s) (Environment):
Progress 9.1D
Progress 9.1E
OpenEdge 10.x
SYMPTOM(s):
The TCP port remains in use.
The socket client (device or process) has disappeared.
Using socket programming in 4GL.
CAUSE:
The KeepAlive mechanism is not activated for the 4GL socket.
TCP KeepAlive is a mechanism with TCP/IP that allows a process to time out and be disconnected if there is no activity for a set period of time or if a connection is dropped.
A TCP daemon runs to monitor the activity on every open TCP connection. If there is no activity over a connection for the time period defined by TCP KeepAlive then the TCP layer sends an empty probe packet to the process to check and see if it is still alive.
If there is no response to the probe packet then the TCP layer closes the connection and notifies the parent process that the child is gone; the parent will react accordingly.
FIX:
Turn the KeepAlive mechanism on with:
hSocket:SET-SOCKET-OPTION("SO-KEEPALIVE","TRUE").
For socket objects created using CREATE SOCKET, the default of SO-KEEPALIVE is FALSE. For socket objects created by Progress and passed as a parameter to the event-procedure context, the default is on.