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

`maxConns` option is ignored for incoming connections #703

Open
feross opened this issue Mar 29, 2016 · 2 comments
Open

`maxConns` option is ignored for incoming connections #703

feross opened this issue Mar 29, 2016 · 2 comments

Comments

@feross
Copy link
Member

@feross feross commented Mar 29, 2016

The maxConns option is currently ignored for incoming connections, so there's effectively no limit the number of incoming connections that we accept.

For TCP, we could just immediately destroy the incoming connection, or perhaps pause the server somehow to avoid accepting in the first place?
For WebRTC, we should consider not ever returning an offer when we're at capacity, since doing the whole signaling process is expensive (webrtc conns are a limited resource; and trackers have limited resources)

@BenjaminLawson

This comment has been minimized.

Copy link

@BenjaminLawson BenjaminLawson commented Mar 16, 2017

we should consider not ever returning an offer when we're at capacity

If all of the peers in a swarm are at capacity, and a new peer joins, what should happen? Won't new peers be unable to join the swarm?

See: http://blog.libtorrent.org/2012/12/swarm-connectivity/

I propose that we use Kademlia's xor distance algorithm to decide to accept or reject a peer based on id, and drop the current peer with the greatest distance. A problem is that the swarm is easy to attack, as mentioned in the article, unless you use ip addresses.

Edit: I've tested this out with bittorrent-tracker and it works.

@stale stale bot added the stale label May 3, 2018
@webtorrent webtorrent deleted a comment from stale bot May 4, 2018
@stale stale bot removed the stale label May 4, 2018
@stale

This comment has been minimized.

Copy link

@stale stale bot commented Aug 2, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Aug 2, 2018
@stale stale bot closed this Aug 9, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 7, 2018
@feross feross reopened this Aug 9, 2019
@webtorrent webtorrent unlocked this conversation Aug 9, 2019
@stale stale bot removed the stale label Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.