Added jni_socket_keep_alive logging

This commit is contained in:
M66B
2020-11-09 08:56:31 +01:00
parent 3f7f98d77d
commit 5b010134ff
2 changed files with 49 additions and 9 deletions

View File

@@ -1057,10 +1057,10 @@ public class EmailService implements AutoCloseable {
int fd = ParcelFileDescriptor.fromSocket(socket).getFd();
int errno = jni_socket_keep_alive(fd, TCP_KEEP_ALIVE_INTERVAL);
if (errno != 0)
throw new ErrnoException("TCP_KEEPIDLE", errno);
socket.setKeepAlive(true);
if (errno == 0)
Log.i("Enabled TCP keep alive");
else
throw new ErrnoException("jni_socket_keep_alive", errno);
}
} catch (Throwable ex) {
Log.e(ex);