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

core/: Merge pending and established connection limits #2253

Closed
wants to merge 1 commit into from

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Sep 28, 2021

Merge pending and established limits for both incoming and outgoing
connections. More specifically merge
ConnectionLimits::with_max_pending_incoming with
ConnectionLimits::with_max_established_incoming and
ConnectionLimits::with_max_pending_outgoing with
ConnectionLimits::with_max_established_outgoing. Connection limits are
checked on Network::dial for outgoing and on Network::accept for
incoming connections.

This (a) simplifies connection limits from an implementations and user
perspective and (b) simplifies returning a connection handler on limit
error as limits can only be exceeded at the start of dialing and
accepting. See 1.

Merge pending and established limits for both incoming and outgoing
connections. More specifically merge
`ConnectionLimits::with_max_pending_incoming` with
`ConnectionLimits::with_max_established_incoming` and
`ConnectionLimits::with_max_pending_outgoing` with
`ConnectionLimits::with_max_established_outgoing`. Connection limits are
checked on `Network::dial` for outgoing and on `Network::accept` for
incoming connections.

This (a) simplifies connection limits from an implementations and user
perspective and (b) simplifies returning a connection handler on limit
error as limits can only be exceeded at the start of dialing and
accepting. See [1].

[1]: libp2p#2242 (comment)
@mxinden mxinden mentioned this pull request Sep 28, 2021
@mxinden
Copy link
Member Author

mxinden commented Sep 28, 2021

Closing here for now. I will likely have a fix for #2242 via #2248.

@mxinden mxinden closed this Sep 28, 2021
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

Successfully merging this pull request may close these issues.

1 participant