PDA

View Full Version : QTcpSocket and keep-alive option.



fanat9
16th February 2008, 15:41
Can't find how to set keep-alive option for sockets. Is it possible to use with QTcpSocket ?
Any ideas ?

jpn
20th February 2008, 16:04
As far as I know, TCP protocol does not provide any keep-alive mechanism. Are you talking about HTTP connection? If so, have you noticed QHttp?

fanat9
20th February 2008, 16:54
Actually, I already got it working. Although it required some modification of QAbstractSocket and QNativeSocketEngine =)

http://msdn2.microsoft.com/en-us/library/ms740476.aspx
http://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/

Thanks.