CympleTech / chamomile

Lightweight p2p library. Support build robust connection on decentralized network.
Apache License 2.0
113 stars 18 forks source link

RFC: support multiple transports at same runtime. #20

Closed sunhuachuang closed 2 years ago

sunhuachuang commented 2 years ago

When peers use different transport, and want to connect, the sender must use the receiver's default transport. Example: Alice use tcp as default, Bob use quic as default.

When Alice wants to connect to Bob, she needs to start a quic connect to Bob, and then they use this quic connection. When Bob wants to connect to Alice, he needs to start a tcp connect to Alice, and then they use this tcp connection.

Tip: quic is server/client in one socket. quic socket must only start one time. And as runtime transport. (Default is QUIC)

And when start a new transport (no default), it will use 0:0:0:0:0 to generate a socket by system.

sunhuachuang commented 2 years ago

LGTM :)