Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing Peer to Peer application in Java [closed]

Tags:

i've got a university project where i need to develop a peer to peer system in java for file sharing.

So in essence several users should be able to share files using the Peer to Peer System.

Can someone give me some guidelines about how to build this system??

like image 894
Noor Avatar asked Feb 07 '11 11:02

Noor


People also ask

What is peer-to-peer programming?

A peer-to-peer network allows computer hardware and software to communicate without the need for a server. Unlike client-server architecture, there is no central server for processing requests in a P2P architecture. The peers directly interact with one another without the requirement of a central server.

What is peer socket?

Socket.IO P2P provides an easy and reliable way to setup a WebRTC connection between peers and communicate using the socket. io-protocol. Socket.IO is used to transport signaling data and as a fallback for clients where the WebRTC PeerConnection is not supported.


1 Answers

For university project read some tutorial about sockets. I believe that this is what your professor is expecting from you. Take for example the following: http://www.oracle.com/technetwork/java/socket-140484.html

There are 2 general solutions: server-full and server-less. In case of server based solutions all your clients should be pre-configured with the server's IP address. Server opens server socket and starts listening. So, each client connects to server and registers. The registration is very simple: server just needs the client's IP. Now server holds a list of connected clients and sends the list to each client. 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.

You can implement server-less solution. In this case you need some discovery mechanism based for example on broadcasting.

I hope this helps. Good luck.

like image 64
AlexR Avatar answered Sep 19 '22 17:09

AlexR