sociomantic-tsunami / dhtproto

Distributed Hash Table protocol definition, client, fake node, and tests
Boost Software License 1.0
5 stars 22 forks source link

Make use of the swarm's `useNode` failure return value #186

Open nemanja-boric-sociomantic opened 5 years ago

nemanja-boric-sociomantic commented 5 years ago

swarm's useNode [1] will be enhanced with the different error code for the cases where the node is not in the connection set and when the node is not currently connected (but it was). dhtproto single node requests (Put, Get, Exists, Remove) should check this exit code and in case of the latter, send node_disconnected instead of no_node error [2] to the user.

[1] https://github.com/sociomantic-tsunami/swarm/issues/372 [2] https://github.com/sociomantic-tsunami/dhtproto/blob/89df0437c606f3c9cb0fffd5d148038b3dd74989/src/dhtproto/client/request/internal/Put.d#L144 https://github.com/sociomantic-tsunami/dhtproto/blob/neo-v0.x.x/src/dhtproto/client/internal/NodeHashRanges.d#L205