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

Specify behaviour of timeout accepting methods of Socket and ServerSocket if timeout is negative

    Details

    • Subcomponent:
    • Resolved In Build:
      b14
    • Verification:
      Not verified

      Description

      Socket.setTimeout(-1) throws IAE, which seems reasonable, but doesn't specify this case.

      ServerSocket.setTimeout(-1) delegates to the SocketImpl.setOption(int,Object) method which only specifies SocketException. PlainSocketImpl throws IAE for this case so ServerSocket.setTimeout(-1) throws IAE.

      socket.connect(socketAddress, -1) throws IAE, which seems reasonable, but doesn't specify this case.

      These methods should be re-examined, maybe the methods can specify IAE to be thrown when the timeout is negative.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chegar Chris Hegarty
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: