mirror of
https://github.com/zap-proto/ocaml-rpc.git
synced 2026-10-30 15:04:28 +00:00
This is needed when the client machine crashes without resetting the connection.
9 lines
256 B
OCaml
9 lines
256 B
OCaml
let have_tcp_keepidle =
|
|
try ExtUnix.All.have_sockopt_int ExtUnix.All.TCP_KEEPIDLE
|
|
with ExtUnix.All.Not_available _ -> false
|
|
|
|
let try_set_idle socket i =
|
|
if have_tcp_keepidle then (
|
|
ExtUnix.All.setsockopt_int socket ExtUnix.All.TCP_KEEPIDLE i
|
|
)
|