--- Begin Message ---
Op 25-4-2020 om 20:04 schreef tbrunz:
1. 'loopback' is a node, just like 'source' and 'destination'.  A network is
a mesh of 'nodes' joined by 'links'.  Your Pharo program represents one of
those nodes: It is the 'loopback' node.

oke, so I can do : loopback := KNetworkNode new.

2. The block in the #linksTowards:do: method is the action to take on a
packet, depending on whether its destination is "you" (loopback), or
something else.

The flood algorithm is the simplest algorithm: "If the destination is not
me, send the packet to everyone else (except the one who sent it to me)."


and that part I still do not see. I "fail"  to see what the block exactly is.

However, there is the possibility of loops in the network, so a slightly
better algorithm is to check "have I seen this packet before?" and if the
answer is "yes", then drop it; otherwise send it via my links.  This will
prevent endless packet sending loops in your network.

-t




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




--- End Message ---

Reply via email to