Random port

This commit is contained in:
Anthony Scemama 2016-03-17 15:27:31 +01:00
parent 58b58acf45
commit 1df8e21ee8
1 changed files with 2 additions and 2 deletions

View File

@ -106,11 +106,11 @@ let run ?(daemon=true) ezfio_filename =
(** Random port number between 49152 and 65535 *)
let port =
let newport =
ref 10000
ref ( 1024 + (Random.int (49151-1024)))
in
while ((check_port !newport) = `Unavailable)
do
newport := !newport + 100
newport := 1024 + (Random.int (49151-1024))
done;
!newport
in