TsgcTCPClient › 속성 › TCPKeepAlive

TCPKeepAlive Property

클라이언트 소켓에서 OS 수준 TCP keep-alive 프로브를 활성화합니다.

구문

property TCPKeepAlive: TsgcTCPKeepAlive read FTCPKeepAlive write SetTCPKeepAlive;

기본값

Enabled=False, Time=7200000, Interval=1000

설명

TCPKeepAlive.Enabled가 True인 경우 전송은 SetKeepAliveValues를 통해 소켓 SO_KEEPALIVE 옵션을 켭니다. Time은 커널이 프로빙을 시작하기 전의 유휴 기간(밀리초, 기본값 7200000, 즉 2시간)이고 Interval은 프로브 간 간격(밀리초, 기본값 1000)입니다. 이러한 프로브는 운영 체제 TCP 스택에서 처리되며 애플리케이션 수준의 HeartBeat 속성과 독립적입니다. 원시 TCP 채널에서 죽은 피어를 감지하는 프로토콜 독립적인 방법이 필요할 때 TCPKeepAlive를 사용하십시오.

예제


oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.TCPKeepAlive.Time := 60000;
oTCP.TCPKeepAlive.Interval := 5000;
oTCP.TCPKeepAlive.Enabled := true;
oTCP.Active := true;

속성으로 돌아가기