http: pass on options
This commit is contained in:
parent
53a13840bd
commit
f3a96257c7
|
@ -1,6 +1,7 @@
|
||||||
use net;
|
use net;
|
||||||
use net::ip;
|
use net::ip;
|
||||||
use net::tcp;
|
use net::tcp;
|
||||||
|
use net::tcp::{listen_option};
|
||||||
|
|
||||||
export type server = struct {
|
export type server = struct {
|
||||||
socket: net::socket,
|
socket: net::socket,
|
||||||
|
@ -11,9 +12,9 @@ export type server_request = struct {
|
||||||
request: request,
|
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 {
|
return alloc(server {
|
||||||
socket = tcp::listen(ip, port)?,
|
socket = tcp::listen(ip, port, options...)?,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue