Module Tcp.Keepalive

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

type state

State of a current connection

val alive : state

An alive connection

val next : configuration:Mirage_protocols.Keepalive.t -> ns:int64 -> state -> action * state

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

module Make : functor (T : Mirage_time.S) -> functor (Clock : Mirage_clock.MCLOCK) -> sig ... end