Skip to content

Commit

Permalink
setReuseAddress=true on API port
Browse files Browse the repository at this point in the history
...windows issues be damned...
this is for linux-in-production
  • Loading branch information
cliffclick committed Aug 21, 2014
1 parent f3a7bcc commit bca7c39
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/java/water/H2O.java
Original file line number Diff line number Diff line change
Expand Up @@ -1060,13 +1060,10 @@ static void initializeNetworkSockets( ) {

// If the user specified the -ip flag, honor it for the Web UI interface bind.
// Otherwise bind to all interfaces.
if (OPT_ARGS.ip != null) {
int defaultBacklog = -1;
_apiSocket = new ServerSocket(API_PORT, defaultBacklog, SELF_ADDRESS);
}
else {
_apiSocket = new ServerSocket(API_PORT);
}
_apiSocket = OPT_ARGS.ip == null
? new ServerSocket(API_PORT)
: new ServerSocket(API_PORT, -1/*defaultBacklog*/, SELF_ADDRESS);
_apiSocket.setReuseAddress(true);

_udpSocket = DatagramChannel.open();
_udpSocket.socket().setReuseAddress(true);
Expand Down

0 comments on commit bca7c39

Please sign in to comment.