Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disconnect message #131

Open
LivInTheLookingGlass opened this issue Jan 19, 2017 · 1 comment
Open

Add disconnect message #131

LivInTheLookingGlass opened this issue Jan 19, 2017 · 1 comment

Comments

@LivInTheLookingGlass
Copy link
Collaborator

LivInTheLookingGlass commented Jan 19, 2017

Reasoning:

In most easy network configurations, one would have a set of initial seeds to facilitate peer discovery. In the current state of this library, those nodes would be overwhelmed with traffic. They would have nearly as many connections as there are nodes.

Mechanism:

When a node (A) gets a new connection, and already has more than 2 * max_outgoing connections, it should:

  • Not send an initial handshake
  • Do send a peerlist
  • Send flags.disconnect

The flags.disconnect message tells the receiver (B) to initiate a disconnect. This would be remembered by A, and A would not react to its disconnection.

You could think of this as a slightly more complicated HTTP 303

Caveats:

This mechanism will need to be modified for the chord schema, as relative distances will begin to matter. In that schema, this will be handled by disconnect_least_efficient.

@LivInTheLookingGlass
Copy link
Collaborator Author

Not necessarily needed, but makes #130 much more feasible

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

No branches or pull requests

1 participant