maidsafe-archive / crust

Reliable p2p network connections in Rust with NAT traversal. One of the most needed libraries for any server-less / decentralised projects
BSD 3-Clause "New" or "Revised" License
956 stars 127 forks source link

Remove (dis)connect API and make the Send API take peer-information #1149

Open ustulation opened 5 years ago

ustulation commented 5 years ago
  1. Send will take a blob which will either help Crust identify which connected peer to send the message to OR will help it make such a connection and then send if not already connected. This will likely be the PubConnectionInfo blob.
  2. Send will not return success or error. It will try connecting + sending for a max of 120secs after which it will silently fail
  3. Apart from the connection blob it'll accept the message itself and the priority as usual.
  4. Don't expose a connect() API anymore
  5. Don't expose a disconnect() API anymore
  6. Multiple send()s to the same peer while in process of establishing a connection should not try establishing more connections - wait for the one connection being established and then try sending all accumulated data to the peer. We say "try" because the connection could be severed before sending all the messages according to the dynamic connections rule (see dyn-conn pool issue)