Skip to content

Connection management #3670

Closed Answered by thomaseizinger
tthebst asked this question in Q&A
Mar 23, 2023 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Hey!

I'm trying to better understand the concept of connections in libp2p. Few questions:

All excellent questions!

* Libp2p allows having many connections to the same peer, but what is the benefit of having multiple connections? Isn't one connection enough if your application runs on a single port and there only is one multiaddr for one peer?

Technically, it is enough. Practically, you can't avoid it. How would you decide which connection to keep if two peers dial each other at the same time?

* Does it makes sense to set [with_max_established_per_peer](https://docs.rs/libp2p/latest/libp2p/swarm/struct.ConnectionLimits.html#method.with_max_established_per_peer) to one?

This functio…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by tthebst
Comment options

You must be logged in to vote
3 replies
@mxinden
Comment options

mxinden Mar 29, 2023
Collaborator

@rkuhn
Comment options

@mxinden
Comment options

mxinden Mar 29, 2023
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants