<table><tr><td style="">giedrius added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D4788" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Hmm, I didn't notice such a problem and thought it should be resolved by keep-alives. Doesn't keep-alive detect broken connections?</p>
<p>I was thinking about keeping old connection for some time in case remaining packets would arrive, but this seemed unreliable: what timeout would be appropriate? What if network is very slow? There would probably would still be cases when packets would be lost, unless lingering connection would be kept for quite a long time.</p>
<p>Considering alternatives, what if when broadcast message is received, an empty packet would be sent on current connection in order to test it? If connection is broken, sending should fail and socket should close. In such case a new connection could be reestablished</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R225 KDE Connect - Android application</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4788" rel="noreferrer">https://phabricator.kde.org/D4788</a></div></div><br /><div><strong>To: </strong>giedrius, KDE Connect<br /><strong>Cc: </strong>albertvaka, MayeulC, menasshock, apol, hkaelberer<br /></div>