Review Request 121711: Modify how the TCP socket established between kdeconnect and the device is set up for keep alive. Use IPPROTO_TCP instead of the getprotobyname method for setting keep alive characteristics and use the QTcpSockect object's own setSocketOption to activate keep alive instead of going via setsockopt.

Albert Vaca Cintora albertvaka at gmail.com
Mon Dec 29 04:44:46 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121711/#review72658
-----------------------------------------------------------

Ship it!


I was never able to find the solution to this problem until you fixed it, many thanks!

Apparently using IPPROTO_TCP instead of getprotobyname() makes no difference, because both (and also the Linux-only constant SOL_TCP) evaluate to the same value. Instead, the fix comes from using Qt's QAbstractSocket::KeepAliveOption instead of SO_KEEPALIVE... even thought Qt documentation says: "Set this to 1 to enable the SO_KEEPALIVE socket option". Mysterious!

Anyway, the bug is fixed now, thanks again! Do you have a KDE developer account to merge this patch? Otherwise I can merge it in your name.

- Albert Vaca Cintora


On des. 28, 2014, 12:11 p.m., Pramod Dematagoda wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121711/
> -----------------------------------------------------------
> 
> (Updated des. 28, 2014, 12:11 p.m.)
> 
> 
> Review request for kdeconnect and Albert Vaca Cintora.
> 
> 
> Repository: kdeconnect-kde
> 
> 
> Description
> -------
> 
> Adjust the parameters used to set keep alive for the device's TCP socket to try and detect device disconnection faster.
> 
> Currently kdeconnect does not seem to properly detect that a device has disconnected, even after a few minutes have elapsed since the device has disconnected, this patch set aims to fix this so kdeconnect detects a disconnected device faster.
> 
> 
> Diffs
> -----
> 
>   core/backends/lan/lanlinkprovider.cpp 39d30370ce225d1979f395fc20f26b23f0e791f1 
> 
> Diff: https://git.reviewboard.kde.org/r/121711/diff/
> 
> 
> Testing
> -------
> 
> Given that a phone is connected to kdeconnect.
> When the phone's wireless is switched off.
> And approximately 10 seconds pass.
> Then kdeconnect detects that the device has disconnected and reflects this fact.
> 
> 
> Thanks,
> 
> Pramod Dematagoda
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20141229/5b11e4c5/attachment-0001.html>


More information about the KDEConnect mailing list