From 24f91e9bec8b255e9e790cb977d37c2d86877ce0 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 11 Jun 2023 11:41:48 +0200 Subject: [PATCH] Choose a port number based on PID --- ocaml/qp_run.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ocaml/qp_run.ml b/ocaml/qp_run.ml index b9d14efe..0cb862ae 100644 --- a/ocaml/qp_run.ml +++ b/ocaml/qp_run.ml @@ -38,7 +38,8 @@ let run slave ?prefix exe ezfio_file = | Unix.Unix_error _ -> try_new_port (port_number+100) in let result = - try_new_port 41279 + let port = 10*(Unix.getpid () mod 2823) + 32_769 in + try_new_port port in Zmq.Socket.close dummy_socket; Zmq.Context.terminate zmq_context;