<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[What does QAbstractSocket::KeepAliveOption actually do?]]></title><description><![CDATA[<p dir="auto">The <a href="http://doc.qt.io/qt-5/qabstractsocket.html#SocketOption-enum" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a> is a bit unclear, but if I enable <code>QAbstractSocket::KeepAliveOption</code> on a TCP socket, will it automatically send the keepalive packets for me?</p>
]]></description><link>https://forum.qt.io/topic/91397/what-does-qabstractsocket-keepaliveoption-actually-do</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 08:20:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/91397.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Jun 2018 12:04:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to What does QAbstractSocket::KeepAliveOption actually do? on Wed, 06 Jun 2018 12:40:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vadi2">@<bdi>Vadi2</bdi></a><br />
Behaviour of <code>SO_KEEPALIVE</code> varies enormously between various OSes, different TCP stacks, etc.  You really do have to do a lot of reading (e.g. <a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a>'s link, stackoverflow etc.) if you <em>really</em> know what it might or might not do.</p>
<p dir="auto">My experience (maybe a bit old now)?  Don't rely on it to do anything.</p>
<p dir="auto">Or, in particular: I used to use to (try to) keep a connection from timing out.  In practice, far from that, what it actually did was: caused my app to notice that a connection had become <em>lost</em>, and so complain, when had I <em>not</em> used it then the app wouldn't have noticed a lost connection till I sent/received, and by then might have silently re-established the connection without complaint.  So I gave up on it!</p>
]]></description><link>https://forum.qt.io/post/462229</link><guid isPermaLink="true">https://forum.qt.io/post/462229</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 06 Jun 2018 12:40:47 GMT</pubDate></item><item><title><![CDATA[Reply to What does QAbstractSocket::KeepAliveOption actually do? on Wed, 06 Jun 2018 12:35:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vadi2">@<bdi>Vadi2</bdi></a><br />
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ee470551(v=vs.85).aspx" target="_blank" rel="noopener noreferrer nofollow ugc">Windows</a>, <a href="https://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/#overview" target="_blank" rel="noopener noreferrer nofollow ugc">Linux</a><br />
the principle should be the same on all platforms (for TCP)</p>
]]></description><link>https://forum.qt.io/post/462228</link><guid isPermaLink="true">https://forum.qt.io/post/462228</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 06 Jun 2018 12:35:07 GMT</pubDate></item><item><title><![CDATA[Reply to What does QAbstractSocket::KeepAliveOption actually do? on Wed, 06 Jun 2018 12:20:50 GMT]]></title><description><![CDATA[<p dir="auto">What does that practically mean on Windows/Linux/macOS?</p>
]]></description><link>https://forum.qt.io/post/462224</link><guid isPermaLink="true">https://forum.qt.io/post/462224</guid><dc:creator><![CDATA[Vadi2]]></dc:creator><pubDate>Wed, 06 Jun 2018 12:20:50 GMT</pubDate></item><item><title><![CDATA[Reply to What does QAbstractSocket::KeepAliveOption actually do? on Wed, 06 Jun 2018 12:15:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vadi2">@<bdi>Vadi2</bdi></a><br />
as the docs also state it sets the <code>SO_KEEPALIVE</code> option on the underlying platform socket.<br />
So you should look up this option for your target platform.</p>
]]></description><link>https://forum.qt.io/post/462222</link><guid isPermaLink="true">https://forum.qt.io/post/462222</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 06 Jun 2018 12:15:27 GMT</pubDate></item></channel></rss>