fix: also make server socket nonblocking

This commit is contained in:
Simon Cruanes 2024-09-03 15:40:26 -04:00
parent cf9c14b1c2
commit e199162e1f
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -122,7 +122,7 @@ let to_tcp_server (self : t) : IO.TCP_server.builder =
let fd = Fd.create sock in
fd, true (* Because we're creating the socket ourselves *)
in
MIO.Unix.clear_nonblock sock;
MIO.Unix.set_nonblock sock;
MIO.Unix.setsockopt_optint sock Unix.SO_LINGER None;
if should_bind then (
let inet_addr = Unix.inet_addr_of_string self.addr in