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

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

XMLWordPrintable

    • b14
    • Not verified

      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.

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

              Created:
              Updated:
              Resolved: