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

Already bound ServerSocket throws SocketException not IOException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • None
    • generic
    • generic

      The ServerSocket API spec states that a bind operation on an
      already bound socket should throw IOException but it throws
      SocketException. True for solaris, win98.

      ---test code ------

      InetAddress[] myInetAddress = InetAddress.getAllByName(localhost);
      ServerSocket mySS = new ServerSocket(3343, 5, myInetAddress[0]);
      InetSocketAddress myIsa = new InetSocketAddress(
                                         myInetAddress[0],3343);
      mySS.bind(myIsa);
      --------------------

      java.net.SocketException: Already bound
              at java.net.ServerSocket.bind(ServerSocket.java:291)
              at java.net.ServerSocket.bind(ServerSocket.java:265)


      test file attached.

            jccollet Jean-Christophe Collet (Inactive)
            kpolomsksunw Krystyna Polomski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: