package tcpip
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=59377ed359080d8da94aec91474a533bad955c12be79827bec853ccb496d659a
sha512=3f2ed5cbd5bdcd9a664e9ee0b7dbfc65b0a698e6c4bb77ee6a85a139b18cdee24415d76fb821466a9aff2e390318a8657b83871768c259557f25684ab6ccf83b
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
A keep-alive timer
create configuration f clock
returns a keep-alive timer which will call f
in future depending on both the configuration
and any calls to refresh