[Qt-interest] QTcpServer timeout ?

Stephen Collyer scollyer at netspinner.co.uk
Wed Jul 21 18:03:53 CEST 2010


On 21 July 2010 15:00, BRM <bm_witness at yahoo.com> wrote:

> The TCP Stack Keep Alive is the proper way to do this. Every modern TCP
> stack supports TCP Keep Alive. TCP KeepAlive is explicitly provided so that
> you don't have to do it in your application.
>

The TCP Keepalive isn't (or wasn't) provided to keep connections alive,
despite its name.

Its original purpose was to check if the host at the other end of the
connection
had crashed or been powered off, leaving a half-open connection from a
client.
The use of TCP Keepalive (v. app. level heartbeats) for detecting if a
remote
host has crashed has a very long and contentious history, but to my mind,
this
kind of functionality belongs in the app. not least because a single kernel
supports only one set of keepalive values, but may run many apps. all
with different keepalive requirements.


>
> The only thing the local sys admin can do is completely disable that
> functionality, but to do that, it would have to be a special kernel build,
>

That isn't the case. All modern OSs allow control over whether TCP
keepalives
are enabled, the keepalive interval, how many keepalives to send before the
connection is closed, and so on. This page:

http://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/

describes them for a Linux kernel. However, bear in mind that the values
that
you set apply to all processes on that machine, whereas an app. level
heartbeat can be sent as often as required, and can carry useful data
(load monitoring, for example) to boot.

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100721/66a86b19/attachment.html 


More information about the Qt-interest-old mailing list