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

(so) SocketChannel.open(SocketAddress) leaks resources if connection cannot be established

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 6
    • core-libs
    • None
    • b13
    • generic
    • generic

      If SocketChannel.open(SocketAddress) is used to open a socket channel and it fails to establish a connection to the peer then it leaks a file descriptor or SOCKET:

          {
              SocketChannel sc = open();
              sc.connect(remote);
              return sc;
          }

      This needs to be fixed to close the socket channel if the connect fails.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: