ex_wire v0.1.1 ExWire.Packet.Ping

Ping is used to determine round-trip time of messages to a peer.

**Ping** `0x02` []

Requests an immediate reply of Pong from the peer.

Link to this section Summary

Functions

Given an RLP-encoded Ping packet from Eth Wire Protocol, decodes into a Ping struct

Handles a Ping message. We send a Pong back to the peer

Given a Ping packet, serializes for transport over Eth Wire Protocol

Link to this section Types

Link to this type t()
t() :: %ExWire.Packet.Ping{}

Link to this section Functions

Link to this function deserialize(rlp)
deserialize(ExRLP.t) :: t

Given an RLP-encoded Ping packet from Eth Wire Protocol, decodes into a Ping struct.

Examples

iex> ExWire.Packet.Ping.deserialize([])
%ExWire.Packet.Ping{}

Handles a Ping message. We send a Pong back to the peer.

Examples

iex> ExWire.Packet.Ping.handle(%ExWire.Packet.Ping{})
{:send, %ExWire.Packet.Pong{}}
Link to this function serialize(packet)
serialize(t) :: ExRLP.t

Given a Ping packet, serializes for transport over Eth Wire Protocol.

Examples

iex> %ExWire.Packet.Ping{}
...> |> ExWire.Packet.Ping.serialize
[]