go-libp2p icon indicating copy to clipboard operation
go-libp2p copied to clipboard

Add Transient as a "connectedness" state

Open Stebalien opened this issue 2 years ago • 2 comments

This will let users:

  1. Quickly detect if the connection to a peer is transient.
  2. Detect transitions from transient to "full" connections (and back) via events.

Stebalien avatar Jan 26 '24 22:01 Stebalien

Needed for https://github.com/ipfs/boxo/pull/526

Stebalien avatar Jan 29 '24 22:01 Stebalien

Can we do?

Detect transitions from transient to "full" connections Can we do? Detect transitions from transient to "full" connections (and back) via events.

~I'm not sure if we can guarantee ordering between notifications for two different connections. The only guarantee right now is that disconnect on a connection is after connect. This behavior I believe was changed in https://github.com/libp2p/go-libp2p/pull/2373/files(and back) via events.~

Ignore this. It does work correct for hole punching.

sukunrt avatar Feb 05 '24 09:02 sukunrt