package tcpip
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d452e23f4e62c8b32c977f742e72c50fe673b82e23dc80b29d8263be764d2c72
sha512=9a4aeb5c7ec0392524d1d261026e5de047dec09054f2dca63d9743aed1d27ccfd655ae693554091b4ef7d9eabfeef218e71e8bf13ea8304ebedd8e8a7d4f484a
doc/tcpip.tcp/Tcp/Keepalive/index.html
Module Tcp.Keepalive
Source
TCP keepalives.
A TCP implementation may send "keep-alives" (empty TCP ACKs with the sequence number set to one less than the current sequence number for the connection) in order to provoke the peer to respond with an ACK of the current sequence number. If the peer doesn't recognise the connection (e.g. because the connection state has been dropped) then it will return a RST; if the peer (or the network in-between) fails to respond to a configured number of repeated probes then the connection is assumed to be lost.
type action = [
| `SendProbe
(*we should send a keep-alive now
*)| `Wait of Duration.t
(*sleep for a given number of nanoseconds
*)| `Close
(*connection should be closed
*)
]
An I/O action to perform
State of a current connection
next ~configuration ~ns state
returns the action we should take given that we last received a packet ns
nanoseconds ago and the new state of the connection