[Qt-interest] QTcpServer timeout ?

Stephen Collyer scollyer at netspinner.co.uk
Wed Jul 21 20:03:46 CEST 2010


On 21 July 2010 18:45, Thiago Macieira <thiago at kde.org> wrote:

> On Wednesday 21. July 2010 13.56.43 André Fillipe wrote:
> > On 21 July 2010 11:39, Thiago Macieira <thiago at kde.org> wrote:
> > > I don't think it is the proper tool for the job.
> > >
> > > TCP Keep-Alive has a timeout of several hours. It's way more than the
> > > usual inactivity timer in NAT firewalls.
> >
> > I thought one could change these settings on a per-socket basis with
> > setsockopt, no?
>
> No, those are Linux extensions. So it's not available everywhere.
>

Well, a bit of Googling shows that the Windows API supports per-socket
keepalive values too, though not via the SOL_TCP options, but AFAICS
FreeBSD still does not. So you probably can't rely on this technique for
cross-platform work.

If you write your own app. level heartbeat, you can be sure that it works
cross-platform (and you can do it without #ifdef's), and it can be extended
to
do a lot more than merely keeping a TCP connection alive. To me, it's a
no-brainer.

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


More information about the Qt-interest-old mailing list