Datasnap.DSTCPServerTransport.TDSTCPChannel.EnableKeepAlive
[–] Properties | |
---|---|
Type: function | |
Visibility: public | |
Source: Datasnap.DSTCPServerTransport.pas Datasnap.DSTCPServerTransport.hpp
| |
Unit: Datasnap.DSTCPServerTransport | |
Parent: TDSTCPChannel |
Delphi
function EnableKeepAlive(KeepAliveTime: Integer; KeepAliveInterval: Integer = 100): Boolean;
C++
bool __fastcall EnableKeepAlive(int KeepAliveTime, int KeepAliveInterval = 0x64);
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 aKeepAlive
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. |