Client and server, based on TCP for file sharing.
Written in Python 2.7 on Linux.
Clone the repo:
$ git clone https://github.com/sagyas/file-sharing-network.git
Simulation of user1
sharing a file with user2
:
Step #1:
Prepare a folder to simulate user1
with a file to transfer, and a folder to simulate user2
.
Run the server on a chosen port from the folder of user2
, using the following command:
user2:~$ python server.py <server-port>
Step #2:
From user1
run the client on mode 0
for Listening Mode, and specify the server's IP and port, and the listening port, using the following command:
user1:~$ python client.py 0 <server-ip> <server-port> <listening-port>
Step #3:
From user2
run the client on mode 1
for User Mode, and specify the server's IP and port, using the following command:
user2:~$ python client.py 1 <server-ip> <server-port>
Step #4:
Search for a file name in double quotation marks, for example: "a"
.
Step #5:
Select the desired file by specifying its number, for example: 1
.
And the file was transferred to user2
folder!