libp2p/protocols/ping

    Dark Mode
Search:
Group by:
  Source   Edit

Ping protocol implementation

Types

Ping = ref object of LPProtocol
  pingHandler*: PingHandler
  rng: ref BrHmacDrbgContext
  Source   Edit
PingError = object of LPError
  Source   Edit
PingHandler {.public.} = proc (peer: PeerId): Future[void] {....gcsafe,
    raises: [Defect].}
  Source   Edit
WrongPingAckError = object of PingError
  Source   Edit

Consts

PingCodec = "/ipfs/ping/1.0.0"
  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

Methods

method init(p: Ping) {....raises: [Defect], tags: [].}
  Source   Edit