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??
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With