Closed aiqueneldar closed 12 years ago
When someone connected send an '!' message to all clients with routing information. These already connected will only need a patch with the new client.
How should the routing message look like
Well I guess that is up to you as it only a minor detail internal to the class, but I would suggest:
For the already connected clients:
!route:#\0
where # is the needed information and \0 is NUL.
I think you will only need IP (#₁
), ID (#₂
) and which ID the new client is connected to (#₃
),
in that case #₁:#₂:#₃
may be good.
For the new client:
!route:#₁:#₂:#₃\0
as described above, one message for each client, but replace "route" with "routed",
that is !routed:#₁:#₂:#₃\0
. Then this is an unrouted client, the first peer (that created the cloud), a
message for that client should also be send — however, sending it first may be a good idea — that
look like !unrouted:#₁:#₂\0
. When all these are sent !route:#₁:#₂:#₃\0
should be sent.
So:
!unrouted:#₁:#₂\0
(created the cloud)
!routed:#₁:#₂:#₃\0
(connected client)
!routed:#₁:#₂:#₃\0
(connected client)
!routed:#₁:#₂:#₃\0
(connected client)
!route:#₁:#₂:#₃\0
(the new client)
Even if I decide how it's done, everyone needs to know what I choose. And everyone has the right to come with input. This was one of the things that was a promise to Ann. Everyone needs to know every part of the code as usual when coding for university courses. And I have tried to get across that everyone is entitled to input before things get decided. That's why I early on said "Tell the rest of the group your idea. Let them come with input, THEN implement it as code. Do NOT write the code first as the others might want it to be different.". And that's why I tried to have a meating where we where supposed to decide all the stuff so that everyone got a say, and so that everybody knew what everybody else was doing, and how they are doing it.
Of cause we need to know how it work, but we might not have time to decide every detail together; as long as we have an agreed basis for the message, there should be no problem.
Yes, but we need to discuss details a lot because a lot if details make a big difference here. And we need to make time for that as well.
How should routing be handled? High-level protokoll with a BlackboardMessage i.e. RouteMe. or a low-level protokol i.e. a '!' message to ConnectionNetworking.
As I see it, there will be faster to use the low-level version. Although, the routing table needs to be copied to every client, so that if a router quits unexpectedly another host that can be router takes over the routing and corrects and send the routing table to the cloud. The spreading of information is eaiser the high-level way. Any good ideas?