aboutsummaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-13 19:24:33 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-13 19:24:33 +0800
commit6d8dcf7a7c0db67da322243d049ad8a4255f7f1c (patch)
tree898e17aeb63deaf446e5fdfe6206ad9a7c38777a /main.ha
parentAdd architecture stuff to the README (diff)
downloadforge-6d8dcf7a7c0db67da322243d049ad8a4255f7f1c.tar.gz
forge-6d8dcf7a7c0db67da322243d049ad8a4255f7f1c.tar.zst
forge-6d8dcf7a7c0db67da322243d049ad8a4255f7f1c.zip
Set reuseport and reuseaddr
Diffstat (limited to 'main.ha')
-rw-r--r--main.ha7
1 files 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");