From d01ed36a2788d2d5e9f82884e7d91425dd27b4ed Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 6 Mar 2017 18:46:04 +0100 Subject: [PATCH] Fixed OCaml Address in use --- ocaml/TaskServer.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ocaml/TaskServer.ml b/ocaml/TaskServer.ml index 23e887e6..a1625719 100644 --- a/ocaml/TaskServer.ml +++ b/ocaml/TaskServer.ml @@ -65,7 +65,11 @@ let bind_socket ~socket_type ~socket ~port = let filename = Printf.sprintf "/tmp/qp_run:%d" port in - Sys.remove filename; + begin + match Sys.file_exists filename with + | `Yes -> Sys.remove filename + | _ -> () + end; ZMQ.Socket.bind socket ("ipc://"^filename)