Built a group based file sharing system where users can share, download files from the group they belong to. Download should be parallel with multiple pieces from multiple peers.
Socket Programming, SHA1 hash, Multi-threading
The Following entities will be present in the network :
- Tracker: Maintain information of clients with their files(shared by client) to assist the clients for the communication between peers
- Clients: Retrieve peer information from tracker for the file and download file from multiple peers simultaneously and all the files which client downloads will be shareable to other users in the same group.
- Go to tracker directory
g++ tracker.cpp -o tracker -lpthread
- Go to client directory
g++ client.cpp -o client -lssl -lcrypto -lpthread
- To run the Server
./tracker <tracker_ip> <tracker_port>
eg : ./tracker 127.0.0.1 8000
- To run the Client
./client <client_ip> <client_port> <tracker_ip> <tracker_port>
creating client1 on new terminal with socket : 127.0.0.1:8000
eg : ./client 127.0.0.1 3000 127.0.0.1 8000
- Create User Account :
create_user <user_id> <passwd>
- Login :
login <user_id> <passwd>
- Create Group :
create_group <group_id>
- Join Group :
join_group <group_id>
- Leave Group :
leave_group <group_id>
- List Pending Request :
requests list_requests <group_id>
- Accept Group Joining Request :
accept_request <group_id> <user_id>
- List All Group In Network :
list_groups
- List All sharable Files In Group :
list_files <group_id>
- Upload File :
upload_file <file_path> <group_id>
NOTE: Enter absolute path of the file.
- Download File :
download_file <group_id> <file_name> <destination_path>
NOTE: Enter absolute path of the destination. 12. Logout :
logout
- Show_downloads :
show_downloads
Output format: [D] [grp_id] filename [C] [grp_id] filename D(Downloading), C(Complete)
- Stop sharing :
stop_share <group_id> <file_name>