Closing a SSLSockets input or output stream does not close the socket (https://issuetracker.google.com/issues/37018094)
Summary:
When you close a SSLSockets input or output stream the socket does not get closed leading to may
sockets in the CLOSE_WAIT state. This will eventually deplete the available file descriptors
Test Plan:
Before appying this patch share a file from desktop to android
After the share is finished issue the command:
netstat -pW | grep kde
There should be a line showing that the socket used is in the state CLOSE_WAIT like below
tcp6 0 0 ::ffff:192.168.0.32:33604 ::ffff:192.168.0.2:1739 CLOSE_WAIT 6200/org.kde.kdeconnect_tp
Apply this patch and repeat the test. Now there should no longer be any sockets in the CLOSE_WAIT state
Reviewers: KDE Connect, nicolasfella
Reviewed By: KDE Connect, nicolasfella
Subscribers: nicolasfella, kdeconnect
Tags: KDE Connect
Differential Revision: https://phabricator.kde.org/D17320