| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
LibP2P.NAT.AutoNAT.Service
Description
Background AutoNAT v1 reachability probing.
The client only probes peers that already have a direct connection. It never dials a peer merely to ask for a dial-back, bounds each request with a timeout, probes one peer at a time, and throttles repeated requests to the same peer.
Synopsis
- data AutoNATClientConfig = AutoNATClientConfig {}
- defaultAutoNATClientConfig :: AutoNATClientConfig
- data AutoNATClientService
- startAutoNATClient :: Switch -> AutoNATClientConfig -> IO AutoNATClientService
- autoNATClientStatus :: AutoNATClientService -> IO NATStatus
- stopAutoNATClient :: AutoNATClientService -> IO ()
Documentation
data AutoNATClientConfig Source #
AutoNAT client scheduling and resource bounds.
Constructors
| AutoNATClientConfig | |
Fields
| |
Instances
| Show AutoNATClientConfig Source # | |
Defined in LibP2P.NAT.AutoNAT.Service Methods showsPrec :: Int -> AutoNATClientConfig -> ShowS # show :: AutoNATClientConfig -> String # showList :: [AutoNATClientConfig] -> ShowS # | |
| Eq AutoNATClientConfig Source # | |
Defined in LibP2P.NAT.AutoNAT.Service Methods (==) :: AutoNATClientConfig -> AutoNATClientConfig -> Bool # (/=) :: AutoNATClientConfig -> AutoNATClientConfig -> Bool # | |
defaultAutoNATClientConfig :: AutoNATClientConfig Source #
go-libp2p scheduling defaults, with four peers per cycle to satisfy the AutoNAT v1 requirement for more than three agreeing dial reports.
data AutoNATClientService Source #
Handle for observing and stopping the background client.
startAutoNATClient :: Switch -> AutoNATClientConfig -> IO AutoNATClientService Source #
Start periodic reachability probing and attach its lifetime to the Switch.
autoNATClientStatus :: AutoNATClientService -> IO NATStatus Source #
Read the most recently aggregated reachability status.
stopAutoNATClient :: AutoNATClientService -> IO () Source #
Stop the client and cancel any in-flight request.