CympleTech / chamomile

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

RFC: Under relay find can directly, changed it. #13

Closed sunhuachuang closed 3 years ago

sunhuachuang commented 3 years ago

What ?

when peer stable connections is relay, and then find a directly incoming, and it is this stable connection, change the stable connection to directly.

Why ?

Better connection.

How ?

When incoming stream to server, server check it is new & check it is stable connection on relay.

if peer_list.stables.contains(peer_id) && peer_list.stables.get(peer_id).unwrap().is_relay {
    //
}
sunhuachuang commented 3 years ago

Over, test is ok.