mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2024-12-21 20:03:31 +01:00
Random port
This commit is contained in:
parent
58b58acf45
commit
1df8e21ee8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user