I am doing an university project. I need some sample programs on peer to peer programs in Java socket programming. Everywhere people are saying to add a server socket in the client program.
Would a single program having server socket and client socket do or do I have to create two programs of one initiating a system and another peer program running thrice to solve the problem?
I know how to do a socket program for client server model and clear on the concept. But creating a peer to peer architecture sounds complex for me to understand.
I also referred to this thread.
The person commented second says "To make peer2peer app each client opens server socket too. When client A wishes to connect to client B it just connects to its socket".
Need some more sample and an explanation on how peer to peer Java socket program works. I don't want any external API like jxta to do this task. I need a clear picture on how it works.