Ping protocol implementation
Types
Ping = ref object of LPProtocol pingHandler*: PingHandler rng: ref BrHmacDrbgContext
- Source Edit
PingHandler {.public.} = proc (peer: PeerId): Future[void] {....gcsafe, raises: [Defect].}
- Source Edit
WrongPingAckError = object of PingError
- Source Edit
Procs
proc new(T: typedesc[Ping]; handler: PingHandler = nil; rng: ref BrHmacDrbgContext = newRng()): T:type {.public, ...raises: [Defect].}
- Create a Ping protocol. The optional handler will be called every time a peer pings us. Source Edit
proc ping(p: Ping; conn: Connection): Future[Duration] {....gcsafe, public(), stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit