int function ( ) { int loc0 = - 1 ; while ( loc0 <= 0 ) { Thread . sleep ( 100 ) ; ServerSocket loc1 = null ; try { loc1 = new ServerSocket ( 0 ) ; loc0 = loc1 . getLocalPort ( ) ; } finally { loc1 . close ( ) ; } } return loc0 ; }
returns the free port on the local host . the function will spin until a valid port number is found . concode_field_sep String NEW_LINE concode_elem_sep char[] hexArray concode_elem_sep String VM_OPTIONS concode_elem_sep Unsafe unsafe concode_elem_sep String JAVA_OPTIONS concode_elem_sep double TIMEOUT_FACTOR concode_field_sep List<String> fileAsList concode_elem_sep List<String> getForwardVmOptions concode_elem_sep String toHexString concode_elem_sep List<String> getVmOptions concode_elem_sep String[] safeSplitString concode_elem_sep String[] getFilteredTestJavaOpts concode_elem_sep String[] addTestJavaOpts concode_elem_sep String getCommandLine concode_elem_sep String getHostname concode_elem_sep String fileAsString concode_elem_sep int tryFindJvmPid concode_elem_sep String[] getTestJavaOpts concode_elem_sep int waitForJvmPid concode_elem_sep Unsafe getUnsafe