So I am new to Java, I have done a bit of c programming. I am trying to make a virtual network of nodes, each node would need to be a thread. The nodes are only allowed to talk to their neighbor nodes. there will be a master node that can talk to any node but the nodes would have to talk to each other to get back to the master node. the master nodes neighbors can talk to the master node.
I was originally going to keep an array list of the nodes, but then I realized all the nodes needed to be there own thread.
My question is how do I pass information back in forward between threads in Java. I need to be able to have the master node give all the regular nodes position information. and I need the regular nodes to be able to pass messages to their neighbor regular nodes.?
here are my git repos if you would like to look at the code I got going now.
https://github.com/fieldju/cs372_project
in C I made a program that used pipes for the children to talk to each other and a server connected the clients, but in this problem the nodes to to have p2p communication as most of them can not directly communicate to the master node / server
Just an Update for anyone who looks at this and wants to see the results. I got the nodes up and running and communicating you can check out the code at
https://github.com/fieldju/cs372_project
I am still working on the distance vector stuff and a few other things but by the end of next week the entire thing should be done.