380 likes | 639 Views
Chapter 4: More Than Two. BOIDS. SIMPLE PEER TO PEER. PEER TO PEER WITH MASTER. Host E. Host E. Host E. Host E. Host D. Host D. Host D. Host D. Host A. Host A. Host A. Host A. Host C. Host C. Host C. Host C. Host B. Host B. Host B. Host B. code(Flock flock).
E N D
Host E Host E Host E Host E Host D Host D Host D Host D Host A Host A Host A Host A Host C Host C Host C Host C Host B Host B Host B Host B
code(Flock flock) create Announce message send message to master host Inactive Active code(Flock flock) create State message send message to every participating host
decode(String str) and Announce message extract flock from received str add FlockRemoteFlag to the Datamodel add FlockRemoteFlag to the Renderer create an Announce message for local flock send the created Announce message to the remote host for each registered remote flock { send the received Announce to remote flock create Announce message for remote flock send created Announce message to sender of flock } decode(String str) and Announce message extract flock from received str add FlockRemoteFlag to the Datamodel add FlockRemoteFlag to the Renderer Inactive/Active Inactive/Active decode(String str) and State message extract flock identifier from received str retrieve FlockRemoteFlag from Datamodel update FlockRemote from data on str decode(String str) and State message extract flock identifier from received str retrieve FlockRemoteFlag from Datamodel update FlockRemote from data on str
Host A Host A Host A Host A Host A Host A Host B Host B Host B Host B Host B Host B Host C Host C Host C Host C Host C Host C Rendez vous Server Rendez vous Server Rendez vous Server Rendez vous Server Rendez vous Server Rendez vous Server
decode(String str) and Announce message extract flock from received str add FlockRemoteFlag to the Datamodel add FlockRemoteFlag to the Renderer code(Flock flock) create Announce message send message to server Inactive/Active Inactive Active code(Flock flock) decode(String str) and State message create State message send message to server extract flock identifier from received str retrieve FlockRemoteFlag from Datamodel update FlockRemote from data on str
receive() and Announce message extract flock from received str add FlockRemote to the datamodel for each registered remote flock { send the received Announce to remote flock create Announce message for remote flock send created Announce message to sender of flock } Inactive/Active
Host A Host A Host A Host A Host A Host A Host B Host B Host B Host B Host B Host B Host C Host C Host C Host C Host C Host C Server Server Server Server Server Server
decode(String str) and Announce message extract flock from received str add Flock to the Datamodel add Flock to the Renderer code(Flock flock) create Announce message send message to rendezvous server Inactive/Active Inactive Active code(Flock flock) decode(String str) and State message create State message send message to every participating host extract flock identifier from received str retrieve Flock from Datamodel update Flock from data on str
decode(String str) and Announce message extract flock from received str add FlockRemote to the Datamodel for each registered remote flock { create stripped version of the received Announce send the stripped Announce to remote flock create Announce message for remote flock send created Announce message to sender of flock } Inactive/Active decode(String str) and State message extract flock identifier from received str for each registered remote flock that is not the sender { send the received State to remote flock }
Host E Host E Host E Host E Host D Host D Host D Host D Host A Host A Host A Host A Host C Host C Host C Host C Host B Host B Host B Host B
code(Flock flock) Joined Inactive create Announce message send message to multicast group code(Flock flock) join multicast group Active Inactive code(Flock flock) create State message send message to multicast group
decode(String str) and Announce message extract flock from received str add Flock to the Datamodel add Flock to the Renderer Inactive/Active decode(String str) and State message extract flock identifier from received str retrieve Flock from Datamodel update Flock from data on str