Explorar o código

enable bind adresss reuse (closed #1980)

Nicolas Cannasse %!s(int64=12) %!d(string=hai) anos
pai
achega
70366b18e3
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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;