Browse Source

enable bind adresss reuse (closed #1980)

Nicolas Cannasse 12 years ago
parent
commit
70366b18e3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      main.ml

+ 1 - 0
main.ml

@@ -506,6 +506,7 @@ let rec process_params create pl =
 
 and wait_loop boot_com host port =
 	let sock = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in
+	(try Unix.setsockopt sock Unix.SO_REUSEADDR true with _ -> ());
 	(try Unix.bind sock (Unix.ADDR_INET (Unix.inet_addr_of_string host,port)) with _ -> failwith ("Couldn't wait on " ^ host ^ ":" ^ string_of_int port));
 	Unix.listen sock 10;
 	Sys.catch_break false;