Question about JXTA peers
I posted this question earlier in the forums of Java Sun but someone told me it was better to ask it over here. So here goes:
At the moment I created a client/server application. If a server is started than the client can connect to this server and a console will appear. With this console, the client can send commands to the server to do some actions (the actions aren't relevant for the question). All peers (server and client) are connected to a RendezVous peer. This all work well. But the main problem is, the JxtaServerSocket uses a PipeAdvertisement that is stored on the harddrive as a file. So you can only connect to the server if you have that file. But what happens if another client has that same file ? An exception will occur. Now I was thinking of rebuilding my application in a way that every peer actually can be a server and a client at the same time. So there is no need for a central server. If I start the Console, I should dynamicly discover peers and add them to a list. I then need to be able to select a peer which I want to connect to.
I was wondering how I can manage all this.
I hope someone can give me feedback on how to begin.