From 6d8dcf7a7c0db67da322243d049ad8a4255f7f1c Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Mar 2025 19:24:33 +0800 Subject: Set reuseport and reuseaddr --- main.ha | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.ha b/main.ha index fc38f25..2df4db4 100644 --- a/main.ha +++ b/main.ha @@ -6,9 +6,10 @@ use getopt; use htmpl; use log; use net; -use net::ip; -use net::http; use net::dial; +use net::http; +use net::ip; +use net::tcp; use os; use memio; use io; @@ -42,7 +43,7 @@ export fn main() void = { }; }; - const server = match (http::listen(ip_addr, port)) { + const server = match (http::listen(ip_addr, port, net::tcp::reuseport, net::tcp::reuseaddr)) { case let this: *http::server => yield this; case net::error => abort("failure while listening"); -- cgit v1.2.3