Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4158021

cannot distinguish Thread.interrupt and Socket.setSoTimeout exceptions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.1.1, 1.1.6, 1.2.0
    • core-libs
    • None
    • beta
    • generic, x86
    • generic, windows_nt

      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.

            michaelm Michael McMahon
            bscheiflsunw Bob Scheifler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: