Skip to content

Commit

Permalink
Fixed #577 - "ZMQException: Address already in use" after bind to ran…
Browse files Browse the repository at this point in the history
…dom port
  • Loading branch information
barakyaari committed Jul 19, 2018
1 parent 796ec58 commit 72a2fda
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/zeromq/ZMQ.java
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,7 @@ public int bindToRandomPort(String addr, int min, int max)
for (int i = 0; i < 100; i++) { // hardcoded to 100 tries. should this be parametrised
port = rand.nextInt(max - min + 1) + min;
if (base.bind(String.format("%s:%s", addr, port))) {
base.errno.set(0);
return port;
}
// port++;
Expand Down

0 comments on commit 72a2fda

Please sign in to comment.