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

SocketException on first read after error; -1 on subsequent reads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.4.0
    • core-libs
    • None
    • hopper
    • generic
    • generic



      When a peer resets a connection the Socket.getInputStream().read()
      method will correctly throw a SocketException indicating that the
      connection has been reset. However the behaviour of subsequent reads
      is platform specific.

      On Windows all subsequent reads will throw a SocketException but
      on Solaris and Linux we will return -1 (eof) or even some data and
      no exception is thrown.

      Additionally the behaviour of available() differs. On Solaris/Linux
      if available() is called then the connection is reset it will
      throw a SocketException and subsequent calls to available() will
      return >= 0. On Windows the available() will return 0 and no
      exception is thrown.


            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: