Skip to content

Option to specify "outbound connections only" in libp2p.hangUp() #299

@dirkmc

Description

@dirkmc

In peer-base each peer keeps connections open to the peers in its Dias set. The Dias set membership changes as peers come online and go offline.

For example:

  • Peer A has a Dias set that includes Peer B
  • Membership changes such that Peer A's Dias set no longer includes Peer B
  • Peer A should disconnect its outbound connection to peer B
  • However if Peer B's Dias set includes Peer A, then that connection should be maintained

So from Peer A's perspective, it only wants to disconnect the outbound connection, leaving any inbound connection intact.

Later, when Peer A shuts down, it wants to disconnect both inbound and outbound connections.

Note that the peer:connect event doesn't indicate if a connection is inbound or outbound, so it's not possible for peer base to keep track of inbound vs outbound connections, and in any case it would simplify the code a lot if we could rely on libp2p to do that instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issuestatus/readyReady to be worked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions