When Socket.setSoTimeout is used, it is impossible to distinguish between an InterruptedIOException that results from a socket timeout, and an InterruptedIOException that results from a Thread.interrupt. This is particularly problematic given the fact that once the exception is caught, Thread.interrupted() will be false (which is itself a bad design decision).
There needs to be a way to distinguish between these two cases, as they often want to be handled differently by the application.
There needs to be a way to distinguish between these two cases, as they often want to be handled differently by the application.
- duplicates
-
JDK-4262589 timeout exception on a socket read call cannot be determined
-
- Closed
-
-
JDK-4062550 Network I/O timeouts should generate a timeout Exception
-
- Closed
-