P2P File Sharing
This project creates a peer-to-peer network for file downloading. It resembles some features of Bit-torrent, but much simplified. There are two pieces of software – peer and file owner.
Steps to execute the project:
First place the 'config' file under the folder C:/p2p/ (Since I am using hardcoded location, change this if needed)
Importing the code into eclipse and run it. This is a straight forward else else if you want to do the same from cmd then follow the below steps
Compile steps: Go to src directory:
- $\project\src>javac edu\p2p\helper\ChunkFileObject.java (class used by everyone)
- $\project\src>javac edu\p2p\serv\Server_p.java
- $\project\src>javac edu\p2p\cli1\Client_P1.java
- $\project\src>javac edu\p2p\cli2\Client_P2.java repeat for all the clients till 5
Run (note give forword slash to locate the class files)
from the same cmd window: first run the server to distribute the non-overlapping chucks to all the peer clients
- $\project\src>java edu/p2p/serv/Server_P
- $\project\src>java edu/p2p/cli1/Client_P1
- $\project\src>java edu/p2p/cli2/Client_P2 repeat to run all the clients
Please refer to all the console outputs under src folder