10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-21 20:03:31 +01:00

Random port

This commit is contained in:
Anthony Scemama 2016-03-17 15:27:31 +01:00
parent 58b58acf45
commit 1df8e21ee8

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