Datasnap.DSTCPServerTransport.TDSTCPChannel.EnableKeepAlive

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function EnableKeepAlive(KeepAliveTime: Integer; KeepAliveInterval: Integer = 100): Boolean;

C++

bool __fastcall EnableKeepAlive(int KeepAliveTime, int KeepAliveInterval = 0x64);

Properties

Type Visibility Source Unit Parent
function public
Datasnap.DSTCPServerTransport.pas
Datasnap.DSTCPServerTransport.hpp
Datasnap.DSTCPServerTransport TDSTCPChannel

Description

Enables keep-alive packets for this channel's socket connection.

The EnableKeepAlive method enables keep-alive packets for the channel's socket connection.

Note: If the channel is idle for longer than KeepAliveTime, then a KeepAlive packet is sent and a response is awaited for the given interval, before terminating the connection. The number of keep-alive packet retries is OS-specific and cannot be specified here.

EnableKeepAlive takes in two parameters, which are described in the following table:

Parameter Meaning

KeepAliveTime

The idle time, in milliseconds, before sending a keep-alive packet.

KeepAliveInterval

How long to wait, in milliseconds, before sending successive keep-alive packets when the previous one receives no response.

See Also