Use IOException rather than SocketException.
There are various other IOExceptions that can be thrown by either toRead.getInputStream() or toRead().read(), but any of them indicate that the concurrent closing of the socket was properly detected. Some examples are SSLHandshakeException, if the socket was part way through the handshake when it was closed, or a bare IOException, if the socket is closed during getInputStream() and we're reading the underlying socket rather than the SSLSocket. Bug: 62640872 Test: cts -m CtsLibcoreTestCases -t libcore.javax.net.ssl.SSLSocketTest#test_SLLSocket_interrupt (cherry picked from commit c5ef172c) Change-Id: Id22cb698bb9a558db63f0c28111aee09252ce96a Merged-In: Id0275d19a0871a1484fe8f5bf644f1b5ea11d16b Merged-In: I9aa12a4b42e778befacf00233b272ae59d9fe49f Merged-In: Id1e57121783813b4e435fbed5760a1d78f906f38
Loading
Please sign in to comment