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

Allow to read current connection limits #2809

Closed
dignifiedquire opened this issue Aug 10, 2022 · 4 comments
Closed

Allow to read current connection limits #2809

dignifiedquire opened this issue Aug 10, 2022 · 4 comments

Comments

@dignifiedquire
Copy link
Member

Currently it is possible to get to the ConnectionLimits struct for the current swarm, but it is not possible to read the actual limits, which would be useful to for components that want to check how close to the limit the current state is.

Bonus: It might be nice if there were some methods like has_reached_outgoing_connection_limit for more explicit checks.

@thomaseizinger
Copy link
Contributor

Perhaps we should report the limit with each new connection?

@mxinden
Copy link
Member

mxinden commented Aug 15, 2022

I would welcome any patches for this.

In case anyone is looking into it, I am currently working on a proposal for generic connection management, i.e. the ability for users to implement their own connection management (e.g. limiting) mechanism. I have not yet published this work.

See also #2118 (comment)

@mxinden
Copy link
Member

mxinden commented Oct 5, 2022

Tracking issue for the above mentioned effort: #2824

First draft: #2828

@thomaseizinger
Copy link
Contributor

Connection limits are now a completely standalone component implemented as NetworkBehaviour. It does currently not expose this functionality but that could easily be added. If really necessary, the behaviour can be forked. Thus closing this issue.

If desired, patches to expose ConnectionLimits are welcome.

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

No branches or pull requests

3 participants