Already bound ServerSocket throws SocketException not IOException

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 1.4.0
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: