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

Windows IPv6 Socket implementation doesn't set the handle to not inherit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 5.0, 6
    • core-libs
    • None
    • b21
    • x86
    • windows_2003, windows_xp

        See http://forums.java.net/jive/thread.jspa?threadID=29654&tstart=0

        You can reproduce this issue running on Windows XP or 2003 with IPv6 enabled.

        --- begin code ---
        public class SockTest
        {
            public static void main(String[] args) throws Exception {
                ServerSocket ss = new ServerSocket(4444);
                Runtime.getRuntime().exec(new String[] {"notepad.exe"});
                ss.close();
            }
        }
        --- end code ---

        The above testcase spawns a notepad. Notepad inherits the handle to the socket, so if you try and re-execute the test if fails with "BindException: Address already in use".

        This is reproducible with Java SE 5, 6, and 7.

              chegar Chris Hegarty
              chegar Chris Hegarty
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: