[Qt-interest] QTcpServer timeout ?

Atlant Schmidt aschmidt at dekaresearch.com
Tue Jul 20 22:01:13 CEST 2010


David:

  It's quite common for TCP connections of all sorts to have an inactivity timer.
  This is especially true if your session connects through a firewall or a "public"
  medium.

  Because you often can't affect the settings of the various inactivity timers
  you may encounter along the way, the usual solution is, as you surmised,
  the use of keep-alive messages. I'm thinking that every five minutes is
  too long, but that will depend on your particular circumstances.

                                    Atlant

________________________________
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of David Boosalis
Sent: Tuesday, July 20, 2010 3:51 PM
To: QtInterest
Subject: [Qt-interest] QTcpServer timeout ?

I have Qt Client applications establishing  connections to server apps based using QtTcpServer(s).  The sockets that send data quite often have no problem staying connected all day.  However the sockets that send notices maybe one every two hours or perhaps just once a day tend to die. I never see a disconnect, but the socket just seems to go to sleep as data fails to arrive to the server.  I was wondering if a time out occurring due to  the lack of activity going across the socket.  I looked at the QTcpServer class for a method that might turn off such a timer but did not see any.  Perhaps this behaviour goes beneath QT and into the  Linux Tcp Server design. If so is there a low level call I can make on the socket ID to keep the connection always alive.  I am thinking about sending a ping every 5 minutes on these sockets.

Any advise on how best to fix this time out is very much appreciated.

-David



Click here<https://www.mailcontrol.com/sr/I!4OVpKykyLTndxI!oX7Uj80y4Ou3KxpV!r3T+n2pvmSjYNf1GW1RvAEvLqzsZV!kcffdYN8DZlTQ40Is2HDWw==> to report this email as spam.

________________________________
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100720/15baa940/attachment.html 


More information about the Qt-interest-old mailing list