Since you seem to be a novice at this, I suggest that you start by using HTTP. I make this suggestion because you will start out with a good number of ready-made clients and servers against which to develop and test the peer component. You can use CGI to develop the server-side code, all the while testing with any conventional web browser. Once your server-side code is fully developed, you can create your own client side code, testing against the known-good server. Also, HTTP is already fully specified, transports well in most environments, is fairly lightweight, and has a large base of example code from which to start. Trying to develop both ends of a client/server system concurrently is a recipe for immense frustration, especially if you are not equipped with a good set of tools, knowledge and experience. At some point, you will need to develop socket level code. A very good primer on that subject is Beej's Guide to Network Programming
, which although targeted to C programmers, should be conceptually applicable to Java.