Hi,please review the following patch. The code was converted from shell script to plain Java. Since it is by-design to bind on a prior-used port, add a few of re-tries for possible BindException.
Bug: https://bugs.openjdk.java.net/browse/JDK-8162521 Webrev: http://cr.openjdk.java.net/~xiaofeya/8162521/webrev.00/ Thanks, Felix