1
Fork 0

http: pass on options

This commit is contained in:
Jan-Erik Rediger 2024-06-01 15:44:54 +02:00
parent 53a13840bd
commit f3a96257c7

View file

@ -1,6 +1,7 @@
use net;
use net::ip;
use net::tcp;
use net::tcp::{listen_option};
export type server = struct {
socket: net::socket,
@ -11,9 +12,9 @@ export type server_request = struct {
request: request,
};
export fn listen(ip: ip::addr, port: u16) (*server | net::error) = {
export fn listen(ip: ip::addr, port: u16, options: listen_option...) (*server | net::error) = {
return alloc(server {
socket = tcp::listen(ip, port)?,
socket = tcp::listen(ip, port, options...)?,
});
};