go-libp2p-core
go-libp2p-core copied to clipboard
Add transport and connection 'Traits'
A transport implementation should be able to signal the capabilities it has by default. Some transports might already have some of the layers we currently add on top, such as QUIC already having build in multiplexing, and cjdns already having transport level encryption.
This can even be extended to help us move to supporting unreliable transports.
I think some of the general traits we want to have are (non-exhaustively):
- HasEncryption
- HasMultiplexing
- IsReliable
Now that all transports are expose all required features, this is less of an issue (no more HasEncryption, HasMultiplexing, IsReliable). However, we will likely still want "traits" for optional (but useful) features.
One example would be https://github.com/libp2p/go-libp2p-swarm/pull/57#discussion_r194146101
Being able to send packets "out of band" or unencrypted would be nice.