Coder Social home page Coder Social logo

PackedNode type need modifications. about tox HOT 8 CLOSED

tox-rs avatar tox-rs commented on May 23, 2024
PackedNode type need modifications.

from tox.

Comments (8)

kpp avatar kpp commented on May 23, 2024

I don't like the distance to depend on the status of the node

from tox.

NamsooCho avatar NamsooCho commented on May 23, 2024

Node having possibility of offline should be replaced with higher priority.
Also, c-toxcore uses this concept of Good and Bad nodes.
When we get new nodes from NodesResponse, we have to select node which will be replaced.

from tox.

kurnevsky avatar kurnevsky commented on May 23, 2024

I suggest not to touch PackedNode struct but create new DhtNode struct (or similar name) because PackedNode is used in packets and should be serialized/deserialized as is. And then we can create functions to convert PackedNode to DhtNode.

from tox.

kurnevsky avatar kurnevsky commented on May 23, 2024

Node having possibility of offline should be replaced with higher priority.

But we can compare nodes outside of distance function, just check status first. distance is used not only for DHT and shouldn't be dependent on node status.

from tox.

kpp avatar kpp commented on May 23, 2024

DhtNode is a good suggestion

from tox.

NamsooCho avatar NamsooCho commented on May 23, 2024

Then I will create DhtNode type, and replace_order() function.
replace_order() will compare status of node and PK's distance.
replace_order() will be used in Kbucket and Bucket.
So, Bucket struct will changed from


struct Bucket {
    nodes: Vec<PackedNode>
    ...
}

to


struct Bucket {
    nodes: Vec<DhtNode>
    ....
}

from tox.

kpp avatar kpp commented on May 23, 2024

let's try

from tox.

kurnevsky avatar kurnevsky commented on May 23, 2024

Then we can merge ClientData with DhtNode.

from tox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.