A SO_TIMEOUT of 1 second often leads to the socket timing out when transferring large files.
ClosedPublic

Authored by eduisters on Nov 8 2018, 6:08 PM.

Details

Summary

When receiving large files (even worse when uploading multiple files) the receiving socket
often times-out.

Test Plan

Send 1 or 2 big files from desktop to android without this patch and you should see 1 or both transfers
fail because of a SO_TIMEOUT

Apply this patch and re-run the test and both transfers should now complete without an SO_TIMEOUT

Diff Detail

Repository
R225 KDE Connect - Android application
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
eduisters created this revision.Nov 8 2018, 6:08 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptNov 8 2018, 6:08 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
eduisters requested review of this revision.Nov 8 2018, 6:08 PM

Strange, shouldn't 1 second be enough?

eduisters edited the test plan for this revision. (Show Details)Nov 16 2018, 8:26 AM

Without this patch I almost always get a SO_TIMEOUT when transferring large files:

11-16 09:23:43.003 4913-5849/org.kde.kdeconnect_tp I/SharePlugin: hasPayload
11-16 09:23:59.653 4913-5861/org.kde.kdeconnect_tp E/SharePlugin: Receiver thread exception
11-16 09:23:59.653 4913-5861/org.kde.kdeconnect_tp W/System.err: java.net.SocketTimeoutException: Read timed out
11-16 09:23:59.663 4913-5861/org.kde.kdeconnect_tp W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
11-16 09:23:59.663 4913-5861/org.kde.kdeconnect_tp W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:811)
11-16 09:23:59.663 4913-5861/org.kde.kdeconnect_tp W/System.err: at java.io.InputStream.read(InputStream.java:162)
11-16 09:23:59.663 4913-5861/org.kde.kdeconnect_tp W/System.err: at org.kde.kdeconnect.Plugins.SharePlugin.SharePlugin.lambda$receiveFile$0(SharePlugin.java:223)
11-16 09:23:59.663 4913-5861/org.kde.kdeconnect_tp W/System.err: at org.kde.kdeconnect.Plugins.SharePlugin.-$$Lambda$SharePlugin$ZYKEDwKPyhgSKEpWVtNwHWTn5AU.run(lambda)
11-16 09:23:59.663 4913-5861/org.kde.kdeconnect_tp W/System.err: at java.lang.Thread.run(Thread.java:818)

+1, This seems to be the motivation because my transfers fail if the connection is not 100% perfect.

albertvaka accepted this revision.Nov 20 2018, 9:58 AM

Let's merge this as it seems to fix problems for you guys. I'm not a network expert, but 1 second seemed like plenty of time for a LAN, though :/

This revision is now accepted and ready to land.Nov 20 2018, 9:58 AM
This revision was automatically updated to reflect the committed changes.