Fix BindException on OSX. See #600
This commit is contained in:
parent
3295145e88
commit
cc1e4d3bc7
@ -20,8 +20,8 @@ import java.net.ServerSocket;
|
|||||||
|
|
||||||
public class TestUtils {
|
public class TestUtils {
|
||||||
|
|
||||||
private final static int START_PORT = 20000;
|
private static int START_PORT = 20000;
|
||||||
private final static int END_PORT = 30000;
|
private static int END_PORT = 30000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a free port which can be used to bind to
|
* Return a free port which can be used to bind to
|
||||||
@ -34,6 +34,7 @@ public class TestUtils {
|
|||||||
ServerSocket socket = new ServerSocket(start);
|
ServerSocket socket = new ServerSocket(start);
|
||||||
socket.setReuseAddress(true);
|
socket.setReuseAddress(true);
|
||||||
socket.close();
|
socket.close();
|
||||||
|
START_PORT = start + 1;
|
||||||
return start;
|
return start;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore
|
// ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user