mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-07 03:35:34 -05:00
fix: also make server socket nonblocking
This commit is contained in:
parent
cf9c14b1c2
commit
e199162e1f
1 changed files with 1 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ let to_tcp_server (self : t) : IO.TCP_server.builder =
|
||||||
let fd = Fd.create sock in
|
let fd = Fd.create sock in
|
||||||
fd, true (* Because we're creating the socket ourselves *)
|
fd, true (* Because we're creating the socket ourselves *)
|
||||||
in
|
in
|
||||||
MIO.Unix.clear_nonblock sock;
|
MIO.Unix.set_nonblock sock;
|
||||||
MIO.Unix.setsockopt_optint sock Unix.SO_LINGER None;
|
MIO.Unix.setsockopt_optint sock Unix.SO_LINGER None;
|
||||||
if should_bind then (
|
if should_bind then (
|
||||||
let inet_addr = Unix.inet_addr_of_string self.addr in
|
let inet_addr = Unix.inet_addr_of_string self.addr in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue