-
My application might do tons of outgoing connections, many of which will be connections to endpoints that it might already have done a connection and still have it opened. If I wanted this to be somewhat optimal, I would like to avoid extra latencies and just re-use connection.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The Previous versions of iroh-net included a Dialer that did something like this. It is still used internally in iroh-gossip and iroh-blobs I think but no longer exposed. We removed because it was an odd tool where it lived, relatively simple to make and somewhat particular to how you want to use connections. I also don't think everyone who does want connection reuse will want them in the same way. I must add the removal was relatively contentious, some folks did feel like this was a loss and users will be wanting this... I would advice against using As to whether how cheap it is to establish connections: This is again a bunch of application tradeoffs. We're quite a fan of using multiple connections between the same nodes for different APLNs. In general adding a 2nd connection is very cheap. Also repeated connections to the same node can be made even cheaper if you can use 0-RTT (basically the main concern for that is that anything you send on 0-RTT can be replayed). The main downside of multiple connections is that the contestion controllers are not aware of each other. This is usually not a big issue and things work very well anyway. But there could be some traffic patterns where you'd notice this. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
The
iroh::Endpoint
itself does not do anything fancy under the hood. If you want to establish multiple independent connections to different nodes (which is totally valid, they might be using different ALPNs!) then you can do so.Previous versions of iroh-net included a Dialer that did something like this. It is still used internally in iroh-gossip and iroh-blobs I think but no longer exposed. We removed because it was an odd tool where it lived, relatively simple to make and somewhat particular to how you want to use connections. I also don't think everyone who does want connection reuse will want them in the same way.
I must add the removal was relatively contentious, some folks did feel…