Enhancement Request PSC00240949 / OE00216870 has been implemented.
Upgrade to OpenEdge 10.2B06 and later to make use of the following functionality:
TcpKeepAlive feature provides the ability for the .NET client user to configure its TCP Keepalive network parameters to the particular network they are using at the time. The configuration of a .NET client's Keepalive parameters will be supplied via its normal run time properties mechanism so that they may be controlled via the application's configuration file or programmatically via the client application.
Detail explanation of parameters:
PROGRESS.Session.TcpKeepAliveTime
Data Type: Integer
Session model: All
Indicates the duration (in milliseconds), during which the TCP connection between a .NET client and its corresponding AppServer remains idle before the client sends a TCP KeepAlive message to the AppServer. User can customize the time duration by any of the following methods:
- Setting the value of the property in the .NET application configuration file. For more information, see the section on checking for failed client connections section in OpenEdge Application Server: Adminstration.
- Passing the value as an integer parameter in the setTcpKeepAliveProperty method. If a user passes an invalid value for the parameter, TcpkeepAliveTime, the system takes the default value. For more information, see the section on checking for failed client connections section in OpenEdge Application Server: Adminstration.
Default: 7,200,000 ms
Note: For more information about the parameter, see Microsoft Windows documentation.
PROGRESS.Session.TcpKeepAliveInterval
Data Type: Integer
Session model: All
Indicates the interval the client waits before resending a TCP KeepAlive message to the AppServer. User can customize the time interval by any of the following methods:
- Setting the value of the property in the .NET application configuration file. For more information, see the section on checking for failed client connections section in OpenEdge Application Server: Adminstration.
- Passing the value as an integer parameter in the setTcpKeepAliveProperty method. If a user passes an invalid value for the parameter, TcpkeepAliveInterval, the system takes the default value. For more information, see the section on checking for failed client connections section in OpenEdge Application Server: Adminstration.
Default: 1000 ms.
Note: For more information about the parameter, see Microsoft Windows documentation.
PROGRESS.Session.TcpMaxDataRetranmission
Data Type: Integer
Session model: All
Indicates the maximum number of times a client is allowed to send TCP KeepAlive message to the AppServer, before the client hangs up the connection. TcpMaxDataRetranmissions is a system property. The system administrator must configure this property in the system registry.
To edit the number of TCP KeepAlive retrials, user must set the TcpMaxDataRetransmissions system property as follows:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Value Name: TcpMaxDataRetransmissions
Data Type: REG_DWORD - Number
Valid Range: 0 - 0xFFFFFFFF
Default: 5
Default: 5 times.
OpenEdge Application Server: Administration
Checking for failed server connections for .NET client
In the previous section, an AppServer pings a client to test whether its connection with it is alive or not. Thus, it can reallocate cached resources used by disconnected clients.
Similarly, a client application that downloads data from a server and then performs a long series of calculations might need to periodically verify that the server that receives its results is still reachable. If the server is not reachable, and there is no alternative server to upload the results to, it might not be useful for the application to continue its calculation and keep the socket connected.
To identify the availability of active connections between a client and the connected AppServer, the TCP KeepAlive messaging protocol is implemented through the TCP layer. The direction of the TCP KeepAlive messages is from the client to the servers. When a client and AppServers are properly configured, the client periodically sends a TCP KeepAlive message to the AppServer and waits for a response. If the AppServer responds within the defined time, then the client knows the connection is valid and resets the countdown for the next TCP keepAlive message. If the AppServer does not respond in the defined time, then the client can presume that there is a failed connection and respond appropriately, usually by disconnecting the socket.
Configuring the .NET client's TCP KeepAlive messaging
User can implement the KeepAlive messaging through the TCP layer by configuring the KeepAlive messaging between the client and its AppServer through any of the following two methods:
Configuring the .NET client through the Application Configuration file
User can manually set the following properties in the Application configuration file of the .NET client:
- PROGRESS.Session.Tcp KeepAliveTime
- PROGRESS.Session.Tcp KeepAliveInterval
Example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="PROGRESS.Session.TcpKeepAliveTime" value="0 ms" />
<add key="PROGRESS.Session.TcpKeepAliveInterval" value="0 ms" />
</appSettings>
</configuration>
Note:
If a user assigns invalid values to the properties, TcpkeepAliveTime and TcpKeepAliveInterval, the system takes the default values, which are 7,200,000 ms and 1000 ms respectively.
Configuring the .NET client programmatically through the setTcpKeepAliveProperty method
User can also set the above properties programmatically by passing them as parameters to the setTcpKeepAliveProperty method:
1. Get hold of the session handle of the client connection.
2. Invoke the setTcpKeepAliveProperty method using the session handle.
3. In the setTcpKeepAliveProperty method, pass the following parameters of type Integer:
- TcpkeepAliveTime
- TcpKeepAliveInterval
Syntax:
public void setTcpKeepAliveProperty(int TcpKeepAliveTime, int TcpKeepAliveInterval)
Note:
If a user passes invalid values to the parameters, TcpkeepAliveTime and TcpKeepAliveInterval, the system takes the default values, which are 7,200,000 ms and 1000 ms respectively. The parameter values are logged in the OpenClient log file.