Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

update ping and pong packets #1558

Closed
subtly opened this issue Apr 8, 2015 · 1 comment
Closed

update ping and pong packets #1558

subtly opened this issue Apr 8, 2015 · 1 comment
Assignees

Comments

@subtly
Copy link
Member

subtly commented Apr 8, 2015

Ping: Add destination endpoint. Rename endpoint property to 'destination' (cosmetic update).
Pong: Add destination endpoint to payload.

@subtly subtly self-assigned this Apr 8, 2015
gavofyork pushed a commit that referenced this issue Apr 17, 2015
cleanup/prep endpoint semantics for #1558 and #1557
subtly added a commit to subtly/cpp-ethereum-micro that referenced this issue Apr 21, 2015
@halfalicious
Copy link
Contributor

It looks like this was done at some point.

  • PingNode destination:

    aleth/libp2p/NodeTable.h

    Lines 347 to 358 in b867f9e

    struct PingNode: DiscoveryDatagram
    {
    using DiscoveryDatagram::DiscoveryDatagram;
    PingNode(NodeIPEndpoint const& _src, NodeIPEndpoint const& _dest): DiscoveryDatagram(_dest), source(_src), destination(_dest) {}
    PingNode(bi::udp::endpoint const& _from, NodeID const& _fromid, h256 const& _echo): DiscoveryDatagram(_from, _fromid, _echo) {}
    static const uint8_t type = 1;
    uint8_t packetType() const override { return type; }
    unsigned version = 0;
    NodeIPEndpoint source;
    NodeIPEndpoint destination;
  • Pong destination:

    aleth/libp2p/NodeTable.h

    Lines 383 to 391 in b867f9e

    struct Pong: DiscoveryDatagram
    {
    Pong(NodeIPEndpoint const& _dest): DiscoveryDatagram((bi::udp::endpoint)_dest), destination(_dest) {}
    Pong(bi::udp::endpoint const& _from, NodeID const& _fromid, h256 const& _echo): DiscoveryDatagram(_from, _fromid, _echo) {}
    static const uint8_t type = 2;
    uint8_t packetType() const override { return type; }
    NodeIPEndpoint destination;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants