-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreadme
82 lines (48 loc) · 2.84 KB
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*******************************************************************/
How to compile the application ?
/*******************************************************************/
1. There are 2 make files for compiling server and client files.
a) makefile.server
b) makefile.client
2. Server files can be compiled by command :
make -f makefile.server
3. Client files can be compiled by command :
make -f makefile.client
/*******************************************************************/
How to run the application ?
/*******************************************************************/
1. Server (tracker) will run as :
./server <TRACKER_IP_1>:<TRACKER_PORT_1> <TRACKER_IP_2>:<TRACKER_PORT_2> <seeder_file> <log_file>
e.g. : ./server 127.0.0.1:8080 127.0.0.1:8080 seeders.txt log_file_server.txt
2. Client (peer) will run as :
./client <CLIENT_IP>:<UPLOAD_PORT> <TRACKER_IP_1>:<TRACKER_PORT_1> <TRACKER_IP_2>:<TRACKER_PORT_2> <log_file>
e.g : ./client 127.0.0.1:8085 127.0.0.1:8080 127.0.0.1:8080 log_file_client_8085.txt
3. Tracker should be up for sharing as well as for getting (downloading) the file.
4. File name of the file to be shared or downloaded should be absoulute path of the file, file name can be
directly accepted, if file is in the same directory where executable file resides.
5. Log file name should be absoulute path of the file, file name can be directly accepted,
if file is in the same directory where executable file resides.
/*******************************************************************/
How to share and download ?
/*******************************************************************/
1. Share the file : client can share files with other peers
Syntax : share <file_path> <mtorrent_file_name>
e.g. : share dir1/3.png 3.mtorrent
e.g. : share /home/aman/Desktop/Sem1/OS/Assignment/torrent-master/aman.txt aman.mtorrent
A message to user, "File shared with trackers!", will confirm that file has shared.
2. Get the file : client can download the files from peers
Syntax : get <mtorrent_file_name> <directory_path>
e.g. : get 3.mtorrent dir2
e.g. : get aman.mtorrent /home/aman/Desktop
A message to user, "File downloaded!", will confirm that file has downloaded.
----------------------------------------------------------------------------------------------------
makefile.server
makefile.client
on three different terminals :
-----------------------------
./server 127.0.0.1:8080 127.0.0.1:8080 seeders.txt log_file_server.txt
./client 127.0.0.1:8085 127.0.0.1:8080 127.0.0.1:8080 log_file_client_8085.txt
./client 127.0.0.1:8086 127.0.0.1:8080 127.0.0.1:8080 log_file_client_8086.txt
share /home/aman/Desktop/Sem1/OS/Assignment/torrent-master/aman.txt aman.mtorrent
get aman.mtorrent /home/aman/Desktop
---------------------------------------------------------------------------------------------------------